FIX: Setting Add Watch May Cause GP Fault or UAE

Last reviewed: October 30, 1997
Article ID: Q94292
2.00 WINDOWS kbenv kbbuglist

The information in this article applies to:

- Microsoft Visual Basic programming system for Windows, version 2.0

SYMPTOMS

You may encounter the error message, "Module has changed; must reset" 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:

  1. Run Visual Basic, or from the File menu, choose New Project (ALT, F, N) if Visual Basic is already running.

  2. From the File menu, choose New form (ALT, F, F). Form2 will be created.

  3. Add the following code to the Form_Click event procedure of Form1:

           Sub Form_Click ()
              Form2.Show 1    '** Show the form modal
           End Sub
    
    

  4. From the Debug menu, choose Add watch (ALT, D, A).

  5. From the Add Watch dialog, add the expression Forms.Count, select the Form/Module context option for Form1.Frm, and choose the OK button.

  6. 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
    
    

  7. From the Run menu, choose Start (ALT, R, S) or press the F5 key to run the sample program.

  8. Click in the Form1 form. Form2 will be displayed.

  9. From the Debug menu, choose Break (ALT, D, K) or press CTRL+BREAK to break execution. This causes the watch expression to be evaluated.

  10. From the Run menu, choose Continue (ALT, R, C) or press the F5 key

        to continue.
    

  11. Click in the Form2 form. The click event of the Form2 form will cause

        execution to break.
    

  12. From the Debug menu, choose Single step (ALT, D, S) or press the F8

        key to single step.
    

  13. Repeat step 12 until you see the "Module has change; must reset" error

        message.
    

  14. Choose the OK button.

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 reference words: buglist2.00 fixlist3.00 2.00 3.00 GPF
KBCategory: kbenv kbbuglist
KBSubcategory: EnvtDes
Solution Type : kbfix


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: October 30, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.