Click to See Complete Forum and Search --> : How do I write an exit function for an MFC dialog app?


Idji
May 17th, 1999, 11:12 AM
I put an exit button on my MFC dialog based application.

I want my exit button and ESC and ALT-F4 to save settings and then exit from the program.


AT the moment OnBtnExit() saves the settings. BUT WHAT SHOULD IT DO THEN?

What is the message which exits the application?
I tried the following functions:
WM_CLOSE does nothing.
DESTROYWINDOW causes a Debug assertion in afxwin2.inl, line 39.
WM_DESTROY does nothing.

Please can someone help.

Idji

BarD
May 17th, 1999, 12:28 PM
As I remember, EndDialog() method closes modal dialog. For non-modal dialogs, DestroyWindow() must work.
Dmitry Barashev.
dbarashev@mail.ru