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

ID: Q94351


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

Keywords :
Version :
Platform :
Issue type :


Last Reviewed: August 19, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.