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

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

The information in this article applies to:

- Standard and Professional editions of Microsoft Visual Basic programming

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