CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: MDI application

  1. #1
    Guest

    MDI application

    Hi all,
    I have an MDI application, in which each child window launches each ocx's. At certain condition i want to exit from application. I have tried "End" statement and "Unload" statement at that condition. It worked well , when there is no modal dialog remain opened. But when there is a modal dialog, the application exits but the process remains still alive. Since only one instance of this application is possible, i can't load it for second time in this situation.
    Could anyone tell me how can i exit from application when a modal dialog is launched.
    Thanks in advance,
    Sajitha



  2. #2
    Join Date
    Aug 1999
    Posts
    7

    Re: MDI application

    You should use

    Unload frmMDIMain



    in the procedure in which you want to end your application rather than

    End



    Before the MDIMain window is unloaded, it ask every child window to determine if there are child windows which cannot be unloaded.If there is a module dialog openning, the child window the dialog belongs to will refuse to be unloaded before you reponse to the dialog and thus the MDIMain window will not be unloaded.
    In fact, if you use Unload statement in your program where you want to exit,you can achieve
    a chance to determine whether you can end your application manully and prevent to do so if it can not be ended.Before the form is unloaded, it process the Form_Unload procedure.If you set the Cancel parameter to 1, the form will not be unload.


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