CDialog::OnCancel or postmessage(wm_cancel)
-
hi, all I kinda fixed the issue but still not sure what's wrong with the previous method. it was having access violation at this point: void CSurchrgDlg::Exit() { if( !m_bCanceled ) { ..... } CDialog::OnCancel(); } now I used "PostMessage( cDlg->GetSafeHwnd(), WM_QUIT, 0, 0 );" replaced the exit funtion at the end of RUN. seems to work. OR I used PostMessage(WM_QUIT); to replace CDialog::OnCancel(); would work, too. could someone tell me what's wrong with the calling the CDialog::OnCancel();? Thank you for your time!
-
hi, all I kinda fixed the issue but still not sure what's wrong with the previous method. it was having access violation at this point: void CSurchrgDlg::Exit() { if( !m_bCanceled ) { ..... } CDialog::OnCancel(); } now I used "PostMessage( cDlg->GetSafeHwnd(), WM_QUIT, 0, 0 );" replaced the exit funtion at the end of RUN. seems to work. OR I used PostMessage(WM_QUIT); to replace CDialog::OnCancel(); would work, too. could someone tell me what's wrong with the calling the CDialog::OnCancel();? Thank you for your time!
Do u mean that no thing happens when calling OnCancle() method? if so, try to overide this ... this is just a guess << >>
-
Do u mean that no thing happens when calling OnCancle() method? if so, try to overide this ... this is just a guess << >>
thanks for your reply. what happened was everything goes well in debug, but it crashes when it called onCancle() in release mode with access violation. I couldn't figure out why it that, by the way, is there a outline for when to use onCancle and when for postmessage()? and for the UNICODE, what is sign for UNICODE inside of a function? thanks again!
-
thanks for your reply. what happened was everything goes well in debug, but it crashes when it called onCancle() in release mode with access violation. I couldn't figure out why it that, by the way, is there a outline for when to use onCancle and when for postmessage()? and for the UNICODE, what is sign for UNICODE inside of a function? thanks again!
valerie99 wrote: everything goes well in debug, but it crashes when it called onCancle() in release mode it's out of my control.... :( let me know also if u overcome this << >>