Click to See Complete Forum and Search --> : "Out Of Memory on adding more forms


Amrit
November 18th, 1999, 03:15 AM
sir,
I am working on a form involving a lot many forms.So as the No of forms increse i find a "OUT OF MEMORY"message from my computer .Or a illegal operation props in
kindly help me out


AmritPalSingh
MTech Production
IIT Delhi
India
110029

Lothar Haensler
November 18th, 1999, 03:18 AM
IMHO there are several ways to overcome VB's limitations.
- modularize your app and create several ActiveX DLLs instead of one huge app.
- reuse forms and create controls dynamically at runtime as needed.

Amrit
November 18th, 1999, 03:42 AM
how do i modularise my application using activex exe.
kindly elaborate a bit

AmritPalSingh
MTech Production
IIT Delhi
India
110029

Amrit
November 18th, 1999, 03:44 AM
thanks for ur reply
how do i modularise my application using activex DLL
it would be nice if you can also tell me how to
reuse the form . Never done that before
kindly elaborate a bit

AmritPalSingh
MTech Production
IIT Delhi
India
110029

Lothar Haensler
November 18th, 1999, 03:45 AM
you could create several vb projects using a project type of "activex dll" that could contain some of the forms in your app.
Than in your main application add a reference to these ActiveX Dlls and call their methods.
How to modularize your app depends heavily on what you want to do.
But IMHO if you have reached the limit of the number of forms it is definitely high time to do that.
Check out the VB docs for details about creating ActiveX DLLs.

November 18th, 1999, 08:42 AM
Do you keep all your forms in a memory? Close those which you do not use right now and set them to Nothing. Until you do this, bynary part of form is sitting in a memory and could give you this problem.
Vlad

Amrit
November 18th, 1999, 11:49 PM
All the forms I am talking about are of tyhe same project..Can i assign nothing to the forms in same application to nothing till they are not in use ??? pls guide me


AmritPalSingh
MTech Production
IIT Delhi
India
110029

Ravi Kiran
November 19th, 1999, 04:11 AM
How many forms do you have?
I have seen projects with abt 40 forms, and were not giving any error.

Like Lother suggests, ActiveX exe/dlls is the way. But first check out if you can avoid the memory problem thru other means?

Also what happens is if you break a connected project into segments, invariable one section would need functionality from other and you end up making pieces bigger than they actually need to be. For ex. I had a project which was taking 10MB of runtime memory, and abt 20 forms. and the single exe size was abt 1.4MB. i managed to break it into 4 parts, resonably well seperated ( i thought ), now each one is abt 600KB in size, ( they all share some source files), and the run time memory requrement comes down to 7MB. Because, at any instance i cannot have less than 3 sections running i cannot hit more low.
Was the trade off worth is the question, i ask myself?!

RK