CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 1999
    Location
    India
    Posts
    10

    "Out Of Memory on adding more forms

    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

  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: "Out Of Memory on adding more forms

    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.


  3. #3
    Join Date
    Nov 1999
    Location
    India
    Posts
    10

    Re: "Out Of Memory on adding more forms

    how do i modularise my application using activex exe.
    kindly elaborate a bit

    AmritPalSingh
    MTech Production
    IIT Delhi
    India
    110029

  4. #4
    Join Date
    Nov 1999
    Location
    India
    Posts
    10

    Re: "Out Of Memory on adding more forms

    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

  5. #5
    Join Date
    May 1999
    Posts
    3,332

    Re: "Out Of Memory on adding more forms

    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.


  6. #6
    Guest

    Re: "Out Of Memory on adding more forms

    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


  7. #7
    Join Date
    Nov 1999
    Location
    India
    Posts
    10

    Re: "Out Of Memory on adding more forms

    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

  8. #8
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: "Out Of Memory on adding more forms

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured