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