Microsoft KB Archive/94351

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

Article ID: 94351

Article Last Modified on 1/9/2003

-

APPLIES TO


 * Microsoft Visual Basic 2.0 Standard Edition

-



This article was previously published under Q94351



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
 Start VB.EXE. Choose New Module from the File menu.  Add the following procedure to MODULE1.BAS (the default module name) in the (general) section: Sub main Open &quot;test1.bas&quot; For Output As #1 For i% = 1 To 4000 Print #1, &quot;sub sub&quot; + Trim$(Str$(i%)) Print #1, &quot;end sub&quot; Next Close End Sub  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. Press the F5 key or ALT+R+S to run and build the TEST1.BAS file. Choose New Project from the File menu. You don't have to save the project outlined in steps 1 through 5 above.</li> Once a New Project is running, choose Add File... from the File menu.</li> 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.</li> 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.</li> Choose New Project from the File menu. Choose the No button on saving FORM1.FRM, and choose the No button on saving PROJECT1.MAK.</li></ol>

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: kbbug kbfix KB94351

-

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

© Microsoft Corporation. All rights reserved.