PRB: Out of Stack Space When One Modal Form Shows Another (103461)
The information in this article applies to:
- Microsoft Visual Basic Standard Edition for Windows 1.0
- Microsoft Visual Basic Standard Edition for Windows 2.0
- Microsoft Visual Basic Standard Edition for Windows 3.0
- Microsoft Visual Basic Professional Edition for Windows 2.0
- Microsoft Visual Basic Professional Edition for Windows 3.0
- Microsoft Visual Basic for MS-DOS
This article was previously published under Q103461 SYMPTOMS
Any of the following error messages can occur when two or more forms in a
program repeatedly show each other modally (SHOW 1).
- Out of stack space.
- Out of memory.
- Out of overlay stack space.
CAUSE
This can happen even if you unload the form, which in turn shows the next
form. A form is not actually unloaded by the Unload statement until all its
event procedures return (End Sub or Exit Sub). Showing a form modally
suspends execution and, like a procedure call, maintains information on the
stack. Further explanation is given in the MORE INFORMATION section below.
WORKAROUNDS- Show the forms non-modally (SHOW 0). It is acceptable practice to have
forms show each other non-modally.
- Do not have modal forms call each other continually. Instead, have an
initial form call all the other forms. Think of this initial form
(probably your startup form) as your foundation with all other forms
called from the foundation.
Modification Type: | Minor | Last Reviewed: | 8/16/2005 |
---|
Keywords: | kbprb KB103461 |
---|
|