CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Posts
    9

    How do I write an exit function for an MFC dialog app?

    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


  2. #2
    Join Date
    Apr 1999
    Posts
    13

    Re: How do I write an exit function for an MFC dialog app?

    As I remember, EndDialog() method closes modal dialog. For non-modal dialogs, DestroyWindow() must work.
    Dmitry Barashev.
    [email protected]


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured