PRB: Infinite Loop if Modal Form Shown in MDIChild's QueryUnload
Article ID: 189617
Article Last Modified on 5/13/2003
APPLIES TO
- Microsoft Visual Basic 5.0 Learning Edition
- Microsoft Visual Basic 6.0 Learning Edition
- Microsoft Visual Basic 5.0 Professional Edition
- Microsoft Visual Basic 6.0 Professional Edition
- Microsoft Visual Basic 5.0 Enterprise Edition
- Microsoft Visual Basic 6.0 Enterprise Edition
This article was previously published under Q189617
SYMPTOMS
When attempting to close an MDI parent form, the application gets caught in
an infinite loop of showing a modal form.
CAUSE
When the MDI parent form is closed, the QueryUnload events of all MDI child
forms are called. If any one of these MDI child forms displays a modal form
during this event, such as prompting to save information, the infinite loop
is initiated.
This behavior will not occur if the MDI child form is closed before the MDI
parent is closed.
RESOLUTION
To work around this problem, explicitly unload the MDI child form in either
the QueryUnload event of that MDI child or in the QueryUnload event of the
MDI parent.
STATUS
This behavior is by design.
Additional query words: kbDSupport kbDSD kbVBp kbVBp500 kbMDI kbVBp600
Keywords: kbprb KB189617