Click to See Complete Forum and Search --> : MDI application


August 13th, 1999, 11:24 PM
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

Hover Xiao Bo
August 15th, 1999, 10:11 PM
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.