FIX Large Sub or Function or Module Can Cause GP Fault or UAE

ID: Q95285


The information in this article applies to:
  • Microsoft Visual Basic Standard and Professional Editions for Windows, version 2.0


SYMPTOMS

You can get a general protection (GP) fault in Windows version 3.1 or an unrecoverable application error (UAE) in Windows version 3.0 when making an .EXE file when you approach the maximum size limit of a sub or function or when a form or code module is larger than about 400K.


WORKAROUND

To work around the problem, break up the code in the large sub, function, or module. In most cases, you will need to identify the largest sub, function, or module in your project and work on breaking it up. If this problem persists after breaking up the largest procedure or module, break up other large procedures or modules until you overcome the problem.


STATUS

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


MORE INFORMATION

The problem occurs with a sub or function because Visual Basic attempts to generate more than 64K of code for the sub or function. However, when you run it from the VB.EXE programming environment, it is possible that the amount of interpreted code generated for the sub or function is slightly less than 64K.

The problem occurs with a code module when the compiler attempts to exceed a compiler segment limit.

Because of these problems, it is usually possible to run the program successfully from the operating environment, but you cannot make an .EXE file.

In Windows version 3.0, there is no way to know whether a large procedure or module is the source of the problem. However, in Windows version 3.1, a GP fault occurs at the address 0067:4C4D if a sub or function is too large or at 0067:4C4E if compiler segment limits were exceeded when you attempted to make an .EXE file.

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

Keywords :
Version :
Platform :
Issue type :


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