AllExperts > Visual Basic 
Search      
Visual Basic
Volunteer
Answers to thousands of questions
 Home · More Visual Basic Questions · Answer Library  · Encyclopedia ·
More Visual Basic Answers
Question Library

Ask a question about Visual Basic
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Robert Nunemaker
Expertise
String manipulation, Database access and usage, Class creation, and encapsulation are my strong suits. Active X Controls and DLL`s also. Although I don`t deal with Crystal - frankly because I don`t like it; I prefer to do things manually.

Experience
Employment history: Programmed with the Air Force for 15 years, and have continued in the private sector for the past 1 year. Used VB (all versions) for the past 8 years.

Organizations: MCP and MCSD certified.

Education: Computer Science Bachelor degree.

Awards: MCP and MCSD certified.

 
   

You are here:  Experts > Computing/Technology > Basic > Visual Basic > attempt to make EXE, I get a out of memory error

Visual Basic - attempt to make EXE, I get a out of memory error


Expert: Robert Nunemaker - 1/6/2009

Question
i have a large VB6 project which runs & compiles in IDE, but when I attempt to make EXE, I get a out of memory error. This has worked previously. I see the MSDN help on this: http://support.microsoft.com/kb/129700 says I need to reduce the public memebers in each module. But the largest amount of one module is 510 definitions.

i looked for the module with lots of definations using the Object Browser, although not all objects are public. I counted and only comes to 500, the msdn link states that a module should have less that 1100 public memebers - what actually is public members? how can i resolve this?


Answer
Your computer likely doesn't have enough memory.  You probably only have 1 GB?  Try closing everything (including some of your services) and recompiling.

Just as important, none of your modules or forms may be more than 64K in size.  If they are, you'll need to break them up.

510 public members is still rather high.  Have you considered changing them to "Types"?

i.e
Private Type Address
  Address1 As String
  Address2 As String
  City As String
  State As String
  ZIP As String
End Type
Public AddressType As Address

Then you can access AddressType.Address1, etc as a single member.

Also, you may want to split it up into a DLL for the business logic and then call that from the GUI.  That would allow you to compile 2 different programs and possibly not max out your memory.

Public members means they are visible throughout the program by ALL functions/subs and anything that instantiates the class.  If something is only needed by a single function or sub, it should be defined there instead with:
  Dim myVar As String
or something similar.  This saves a lot on memory as well as makes it much more secure.

Add to this Answer   Ask a Question


 
User Agreement | Privacy Policy | Kids' Privacy Policy | Help
Copyright  © 2008 About, Inc. AllExperts, AllExperts.com, and About.com are registered trademarks of About, Inc. All rights reserved.