Microsoft KB Archive/94664

= BUG: Chain w/ Modal Form or MsgBox in Menu May Hang Computer =

PSS ID Number: 94664

Article Last Modified on 1/8/2003

-

The information in this article applies to:


 * Microsoft Visual Basic for MS-DOS 1.0

-



This article was previously published under Q94664



SYMPTOMS
Chaining to a form that has a MsgBox or that shows a modal form in a menu click event may cause the computer to hang (stop responding). This problem occurs only when using CHAIN to chain from a compiled program that requires a run-time module (BC.EXE option /O not used).



WORKAROUND
To work around the problem, use one of the following techniques:
 * Compile with BC /O (stand-alone)
 * Use the RUN statement instead of CHAIN. Note that COMMON variables are not preserved so you must save the information in a disk file.
 * Use overlays instead of CHAIN.



STATUS
Microsoft has confirmed this to be a bug in 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.



Steps to Reproduce Problem
 Start VBDOS.EXE. From the File menu, choose New Form... (FORM1.FRM). Exit the Form Designer, and save all changes.  Add the following code to the Form_Click event procedure of Form1: Sub Form_Click MsgBox &quot;In Form1&quot; Chain &quot;Form2&quot; End Sub  From the Run menu, choose Make EXE file... and create an executable .EXE file that requires a run-time module. Start a new project and create another form using the same process. Name the new form FORM2.FRM.</li> In the Forms Designer, from the Window menu, select the Menu Design window.</li> Create a top-level menu with Caption = menu1 and CtlName = menu1.</li> Close the Menu Design window.</li> Exit the Form Designer, and save all changes.</li>  Add the following code to the menu1_Click event procedure of Form2: Sub menu1_Click MsgBox &quot;In FORM2&quot; End Sub </li> From the Run menu, choose Make EXE file... and create an executable .EXE file that requires a run-time module.</li> Exit from the VBDOS.EXE environment.</li></ol>

From the MS-DOS prompt, run FORM1.EXE. Click the form to bring up the message box. Choose the OK button. The chains to FORM2.EXE. Choose the menu item. When you click the OK button to close the MsgBox, the computer hangs (stops responding).

This does not occur if you compile for a standalone (BC /O) program.

Additional query words: VBmsdos buglist1.00 1.00

Keywords: kbbug KB94664

Technology: kbAudDeveloper kbVB100DOS kbVBSearch kbZNotKeyword3

-

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

© 2004 Microsoft Corporation. All rights reserved.