Microsoft KB Archive/129700

= PRB: Compile Out of Memory If too Many Public Members in Class =

Article ID: 129700

Article Last Modified on 12/9/2003

-

APPLIES TO


 * Microsoft Visual Basic 4.0 Standard Edition
 * Microsoft Visual Basic 4.0 Professional Edition
 * Microsoft Visual Basic 4.0 Professional Edition
 * Microsoft Visual Basic 4.0 16-bit Enterprise Edition
 * Microsoft Visual Basic 4.0 32-Bit Enterprise Edition

-



This article was previously published under Q129700



SYMPTOMS
A project containing a class module with a large number (approximately 2000) of public class module variables will run successfully in the IDE but will cause an "Out of memory" error when you attempt to compile the project to make an executable file.



CAUSE
There is a limit to the number of public members you can put in a class module. The out of memory error is caused by exceeding the type library's (object library) capacity limit for definitions. When making an executable file, Visual Basic creates a type library and creates a typeinfo (an object description) for all the basic classes. The public members of the class are moved to the typeinfo in the type library. There is a limit (approximately 1100 members) to the number of definitions that you can have in a module.



RESOLUTION
Limit the number of public members in a class.



STATUS
This behavior is by design.

Additional query words: 4.00 vb4win vb4all

Keywords: kbprb KB129700

-

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

© Microsoft Corporation. All rights reserved.