FIX: GPF/UAE When New Project Loaded After Large Previous Proj

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

The information in this article applies to:

- Microsoft Visual Basic programming system for Windows, version 2.0

SYMPTOMS

A general protection (GP) fault or an unrecoverable application error (UAE) may occur when you choose New Project from the Files menu and the previous project loaded had over 3900 procedures. The problem can occur when one .BAS file has more than 3900 Subs or Functions.

WORKAROUND

To avoid the problem, keep the number of procedures in a single .BAS file under 3900. Try using more than one .BAS file to hold the 3900 procedures instead of having all 3900 procedures in one .BAS file.

STATUS

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

MORE INFORMATION

You may encounter this problem with less then 3900 procedures if lack of memory is a problem. Each procedure can hold a large amount of code and create a problem even though you have less than 3900 procedures.

Steps to Reproduce Problem

  1. Start VB.EXE.

  2. Choose New Module from the File menu.

  3. Add the following procedure to MODULE1.BAS (the default module name) in the (general) section:

       Sub main ()
          Open "test1.bas" For Output As #1
          For i% = 1 To 4000
             Print #1, "sub sub" + Trim$(Str$(i%))
             Print #1, "end sub"
          Next
          Close
       End Sub
    
    

  4. Choose Project... from the Options menu. In the Project window, select the Start Up Form line and change it from the default Form1 to Sub Main.

  5. Press the F5 key or ALT+R+S to run and build the TEST1.BAS file.

  6. Choose New Project from the File menu. You don't have to save the project outlined in steps 1 through 5 above.

  7. Once a New Project is running, choose Add File... from the File menu.

  8. Select the file TEST1.BAS from the Add File window. This is a large (4000 empty procedures) file, so it will take some time to load.

  9. Once the TEST1.BAS file is loaded, choose View Code from the Project window with the TEST1.BAS file highlighted. Then you can view the 4000 empty procedures under the (declarations) section.

  10. Choose New Project from the File menu. Choose the No button on saving

        FORM1.FRM, and choose the No button on saving PROJECT1.MAK.
    

After choosing the second No button, you may receive a UAE or GP fault.


Additional reference words: buglist2.00 fixlist3.00 2.00 3.00
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.