Hi all,
In my MFC application I've create two buttons, OPEN and CLOSE, used to open a text file and close it. I do it as follows.
void CSRFToolDlg::OnBnClickedOpen()
{
char* ReadFileName = "G:\\Work On\\CPP\\SRFTool\\text_file.txt" ;
if(openFile.Open(ReadFileName, CFile::modeCreate | CFile::modeReadWrite))
{
AfxMessageBox("File creates successfully", MB_OK) ;
}
else
{
AfxMessageBox("Error in file opening", MB_OK) ;
}
}
void CSRFToolDlg::OnBnClickedClose()
{
openFile.Close() ;
}
What I want to do is, until user click the Open button the Close button should be disable. How should I do it. Those stuff really new for me.
Thanks