Click here to Skip to main content
15,905,776 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionchar buffers Pin
Programm3r9-Oct-07 23:14
Programm3r9-Oct-07 23:14 
AnswerRe: char buffers Pin
Cedric Moonen9-Oct-07 23:17
Cedric Moonen9-Oct-07 23:17 
GeneralRe: char buffers Pin
Programm3r9-Oct-07 23:30
Programm3r9-Oct-07 23:30 
QuestionRe: char buffers Pin
David Crow10-Oct-07 3:02
David Crow10-Oct-07 3:02 
Question[SOLVED] Enabling a button after previous button click. Pin
CodingLover9-Oct-07 23:14
CodingLover9-Oct-07 23:14 
AnswerRe: Enabling a button after previous button click. Pin
Nelek9-Oct-07 23:19
protectorNelek9-Oct-07 23:19 
GeneralRe: Enabling a button after previous button click. Pin
CodingLover9-Oct-07 23:25
CodingLover9-Oct-07 23:25 
GeneralRe: Enabling a button after previous button click. Pin
Lakshmi_p9-Oct-07 23:39
Lakshmi_p9-Oct-07 23:39 
hi,
Try this one...
Disable the button in OnInitDialog of your dialog class

eg:
GetDlgItem(UR_CLOSE_BUTTON_ID)->EnableWindow(FALSE);

Enable that button in OnBnClickedOpen function

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) ;
GetDlgItem(UR_CLOSE_BUTTON_ID)->EnableWindow(TRUE);
}
else
{
AfxMessageBox("Error in file opening", MB_OK) ;
}

}

Again Disable the button in OnBtnClickedClose()


void CSRFToolDlg::OnBnClickedClose()
{
openFile.Close() ;
GetDlgItem(UR_CLOSE_BUTTON_ID)->EnableWindow(FALSE);
}


If you the control variable of Close button, the user that variable in place of GetDlgItem(UR_CLOSE_BUTTON_ID)




GeneralRe: Enabling a button after previous button click. Pin
CodingLover9-Oct-07 23:53
CodingLover9-Oct-07 23:53 
GeneralRe: Enabling a button after previous button click. Pin
chandu00410-Oct-07 0:46
chandu00410-Oct-07 0:46 
GeneralRe: Enabling a button after previous button click. Pin
CodingLover10-Oct-07 0:50
CodingLover10-Oct-07 0:50 
GeneralRe: Enabling a button after previous button click. Pin
chandu00410-Oct-07 2:48
chandu00410-Oct-07 2:48 
GeneralRe: Enabling a button after previous button click. Pin
CodingLover10-Oct-07 19:04
CodingLover10-Oct-07 19:04 
GeneralRe: Enabling a button after previous button click. Pin
Nelek10-Oct-07 0:47
protectorNelek10-Oct-07 0:47 
GeneralRe: Enabling a button after previous button click. Pin
CodingLover10-Oct-07 0:56
CodingLover10-Oct-07 0:56 
GeneralRe: Enabling a button after previous button click. Pin
Nelek10-Oct-07 1:07
protectorNelek10-Oct-07 1:07 
GeneralRe: Enabling a button after previous button click. Pin
CodingLover10-Oct-07 1:10
CodingLover10-Oct-07 1:10 
AnswerRe: Enabling a button after previous button click. Pin
Hamid_RT9-Oct-07 23:38
Hamid_RT9-Oct-07 23:38 
QuestionFlickering Pin
saisp9-Oct-07 22:58
saisp9-Oct-07 22:58 
AnswerRe: Flickering Pin
chandu00410-Oct-07 0:29
chandu00410-Oct-07 0:29 
QuestionNon-rectangular client area Pin
Nishad S9-Oct-07 22:53
Nishad S9-Oct-07 22:53 
AnswerRe: Non-rectangular client area Pin
Nelek9-Oct-07 23:14
protectorNelek9-Oct-07 23:14 
GeneralRe: Non-rectangular client area Pin
Nishad S9-Oct-07 23:29
Nishad S9-Oct-07 23:29 
GeneralRe: Non-rectangular client area Pin
Nelek10-Oct-07 0:30
protectorNelek10-Oct-07 0:30 
GeneralRe: Non-rectangular client area Pin
Nishad S10-Oct-07 2:27
Nishad S10-Oct-07 2:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.