Saying "Add a WM_CLOSE handler" is the same as saying "override OnClose" ;):wave:Quote:
Originally posted by TDM
Actually you'll want to override the OnClose in the MainFrame....right?
TDM
Printable View
Saying "Add a WM_CLOSE handler" is the same as saying "override OnClose" ;):wave:Quote:
Originally posted by TDM
Actually you'll want to override the OnClose in the MainFrame....right?
TDM
Your original statement was;
And then i replied;Quote:
Add a WM_CLOSE handler and ask the user if he wants to save the file. If he/she presses cancel, don't call "CDialog::OnClose();" otherwise do call it and the app will close.
My reply was in reference to the fact that you specified CDialog as the base class.Quote:
Actually you'll want to override the OnClose in the MainFrame....right?
Then you replied;
The CDialog base class does not have an OnClose() function therefore it would be impossible to override the OnClose() function in the CDialog base class. However the CFrameWnd base class does have an OnClose function (for handling the WM_CLOSE message) and it is therefore possible to override the OnClose function for CFrameWnd. ;) :p :wave:Quote:
Saying "Add a WM_CLOSE handler" is the same as saying "override OnClose"
TDM
Of course you are right that I shouldn't have written CDialog::OnClose() because he is using a view architecture.
But you say CDialog does not have an OnClose()? CWnd does have an OnClose and CDialog derives from CWnd, so CDialog also has an OnClose ;)
You are correct...I was just checking to see if you were paying attention.:D :lol:
TDM
:lol: :cool:Quote:
Originally posted by TDM
You are correct...I was just checking to see if you were paying attention.:D :lol:
TDM
tks a lot guys... really appreciate your help..:)
one last question though...im MainFrm, i only have access to
AfxMessageBox right?
but AfxMessageBox doesnt gimme an option to make my messbox into an "OK CANCEL" box...
is there any way i can do that...i mean make the messagebox into an OK_CANCEL message box frm mainfrm??
tks a lot :)
Another last one? :DQuote:
Originally posted by Joseph_R_Thomas
one last question though...
What do you mean by "only access to AfxMessageBox"?Quote:
Originally posted by Joseph_R_Thomas
im MainFrm, i only have access to AfxMessageBox right?
Doesn't it?Quote:
Originally posted by Joseph_R_Thomas
but AfxMessageBox doesnt gimme an option to make my messbox into an "OK CANCEL" box...
Code:AfxMessageBox(_T("Read MSDN..."), MB_OKCANCEL);
And again.... its Mr.gstercken to the rescue ... :)
thank you very much:) appreciate your help..:)
no more last questions :p
:D