FIX: Too Many Controls on a Form May Crash Visual Basic IDE

Last reviewed: December 18, 1997
Article ID: Q167165
The information in this article applies to:
  • Microsoft Visual Basic Control Creation, Learning, Professional, and Enterprise Editions for Windows, version 5.0

SYMPTOMS

When compiling, running, or showing a form with too many controls on it, the IDE may crash with an error similar to one of the following on Windows 95:

   "This program has caused an illegal operation and will be shut down. If
   the problem persists, contact the program vendor. VB5 caused an invalid
   page fault in module VB5.EXE"

   -or-

   "This program has caused an illegal operation and will be shut down. If
   the problem persists, contact the program vendor. VB5 caused an invalid
   page fault in module VBA5.DLL"

Under Windows NT 4.0, an error similar to one of the following may be encountered:

   "Application Error: The instruction at "0x00417DAA" referenced memory at
   "0x021E41FA". The memory could not be "read". Unhandled exception in
   VB5.EXE 0xC0000005: Access Violation"

   -or-

   "Application Error: The instruction at "0x0FAD85F8" referenced memory at
   "0x01EE0112". The memory could not be "read." Unhandled exception in
   VBA5.DLL 0xC0000005: Access Violation"

The memory addresses above are just examples. The addresses encountered may vary.

It is also possible for this bug to simply cause the error:

   “Error encountered during load”

when opening a project that contains Forms with too many controls. This will be most likely encountered when converting a Visual Basic 4.0 application.

CAUSE

When a project with a form containing too many controls is loaded into Visual Basic 5.0, you may encounter incorrect name space mapping of controls. This includes controls that are elements of control arrays. The incorrect mappings may lead to the above-noted problems in the IDE.

RESOLUTION

To work around this bug, follow the steps below:

  1. Remove any forms that have too many controls from the project.

  2. With the project loaded, re-add the forms to the project using the "Project\Add File" menu. When you re-add the file in this way, Visual Basic correctly handles the naming of the controls.

NOTE: The forms will have to be added individually every time the project is loaded. Trying to load the entire project will result in error.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug has been fixed in Visual Studio 97 Service Pack 2.

For more information on the Visual Studio 97 Service Pack 2, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q170365
   TITLE     : INFO: Visual Studio 97 Service Packs - What, Where, and Why

For a list of the Visual Basic 5.0 bugs that were fixed in the Visual Studio 97 Service Pack 2, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q171554
   TITLE     : INFO: Visual Basic 5.0 Fixes in Visual Studio 97
               Service Pack 2
Keywords          : vb5all VBKBDesignTime VBKBEnv VBKBError VBKBVB VS97FixlistSP3 kberrmsg kbui VS97FixlistSP2 VB5FixlistSP2
Version           : 5.0
Platform          : WINDOWS
Issue type        : kbbug
Solution Type     : kbfix kbservicepack


================================================================================


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: December 18, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.