Microsoft KB Archive/94292

= FIX: Setting Add Watch May Cause GP Fault or UAE =

Article ID: 94292

Article Last Modified on 1/8/2003

-

APPLIES TO


 * Microsoft Visual Basic 2.0 Standard Edition

-



This article was previously published under Q94292



SYMPTOMS
You may encounter the error message, &quot;Module has changed; must reset&quot; after which the program ends and returns to design mode. Setting a watch point contributes to the problem. In one case, you may receive the error and then get a general protection (GP) fault or an unrecoverable application error (UAE).

In general, this problem occurs under the following conditions:


 * A global, form, or module-level watch point is set.
 * The watch point refers to a Visual Basic object such as a form or control.
 * The watch point is evaluated from break mode when a modal form is showing.



STATUS
Microsoft has confirmed this to be a problem in Microsoft Visual Basic version 2.0 for Windows. This problem was corrected in Microsoft Visual Basic version 3.0 for Windows.



MORE INFORMATION
The following steps reproduce the problem:

 Run Visual Basic, or from the File menu, choose New Project (ALT, F, N) if Visual Basic is already running. From the File menu, choose New form (ALT, F, F). Form2 will be created.  Add the following code to the Form_Click event procedure of Form1: Sub Form_Click Form2.Show 1   '** Show the form modal End Sub  From the Debug menu, choose Add watch (ALT, D, A). From the Add Watch dialog, add the expression Forms.Count, select the Form/Module context option for Form1.Frm, and choose the OK button.  Add the following code to the Form_Click event procedure of Form2, and press the F9 key to set a break point on the End Sub statement. Sub Form_Click Form2.Hide End Sub     '** Set the break point on this line, press F9                        </li> From the Run menu, choose Start (ALT, R, S) or press the F5 key to run the sample program.</li> Click in the Form1 form. Form2 will be displayed.</li> From the Debug menu, choose Break (ALT, D, K) or press CTRL+BREAK to break execution. This causes the watch expression to be evaluated.</li> From the Run menu, choose Continue (ALT, R, C) or press the F5 key to continue.</li> Click in the Form2 form. The click event of the Form2 form will cause execution to break.</li> From the Debug menu, choose Single step (ALT, D, S) or press the F8 key to single step.</li> Repeat step 12 until you see the &quot;Module has change; must reset&quot; error message.</li> Choose the OK button.</li></ol>

This results in a GP fault or UAE. In the case of a GP fault, the GP fault normally occurs at address 0001:7F8A in module VB.EXE.

This problem also occurs if you select a global-level watch context in step 5. However, the problem doesn't occur if you select a procedure-level watch context in step 5.

To avoid the problem, either don't set a watch point on an expression that contains a Visual Basic object or don't break execution while a modal form is being shown.

Additional query words: buglist2.00 fixlist3.00 2.00 3.00 GPF

Keywords: kbbug kbfix KB94292

-

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

© Microsoft Corporation. All rights reserved.