Microsoft KB Archive/94937

= Computer Hangs When Load Then Unload Form in Form_Load Event =

PSS ID Number: 94937

Article Last Modified on 1/9/2003

-

The information in this article applies to:


 * Microsoft Visual Basic for MS-DOS 1.0

-



This article was previously published under Q94937



SYMPTOMS
If you load a form that has a menu item on it and then immediately unload it in the interpreter environment, the computer hangs (stops responding to This problem does not occur in a compiled program.



STATUS
Microsoft has confirmed this to be a bug in both the Standard and Professional Editions of Microsoft Visual Basic version 1.0 for MS-DOS. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.



MORE INFORMATION
One way to work around the problem is to omit the menu bar from any form that you load and unload. Another way is to call a procedure from the Form_Load event of the first form instead of loading and unloading the form because the only reason you would want to load and unload a form in this manner is to execute the Form_Load event.

Steps to Reproduce Problem

 * 1) Start VBDOS.EXE.
 * 2) From the File menu, choose New Form... (FORM1.FRM).
 * 3) From the File menu in the Forms Designer (FD.EXE), choose New Form...

(FORM2.FRM).

 From the Window menu in FD.EXE, choose Menu Design Window. Add a top-level menu. Set the Caption property to test and the CtlName property to test. Close the Menu Design window. From the File menu, choose Exit, and save all changes.  Add the following code to the Form_Click event procedure of Form1: Sub Form_Click Load Form2 Unload Form2 End Sub  Run the application. Click the Form1 form.</li></ol>

At this point, your computer hangs (stops responding). You have to reboot (restart) your computer.

Additional query words: VBmsdos buglist1.00 1.00

Keywords: KB94937

Technology: kbAudDeveloper kbVB100DOS kbVBSearch kbZNotKeyword3

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© 2004 Microsoft Corporation. All rights reserved.