Creating (a lot of) MDIChild forms crashes VB 
Author Message
 Creating (a lot of) MDIChild forms crashes VB

Hello;

With Visual Basic version 4.0 (16 && 32) and 5.0 I have memory problems
with an MDI based application. I use the SET xxx = NEW ChildFormName to
generate new childforms, then try to reference any control or variable
on the form.

After creating about 20 child forms the application return an out of
memory error when referencing the form (not when creating it!!). Some
error handling is present so the application will run on. The strange
thing is that when again trying to create childforms, it will just
work!!. However when unloading the childforms the application will
crash, taking the VB IDE with it.

The child form hosts an SSTAB, some SSPANEL (loaded with shapes, labels
and lines) and  some GRAPH controls.

Has anyone ever had the same problems or has any clue to whats
happening,

        regards, Frank



Sat, 22 Jul 2000 03:00:00 GMT  
 Creating (a lot of) MDIChild forms crashes VB

I've had a similar experience trying to pull up multiple child windows --
after some number (it was fairly consistent for each application -- usually
in the high twenties or low thirties) the next window reference would return
"Out of memory" (i think it was error 7).

It turns out that there is a limit of the total number of controls that can
be loaded by an app under VB and, while i had thought i was WELL under that
number by counting the number of controls on the child windows, i forgot
that each menu pick in each MDI child form ALSO counts as a separate
control. **Yuck!** Even if all of the forms share a common menu, if they
have (typically) 100 or so menu picks, that's 100 times the number of child
forms loaded. . . so it adds up.

If it matters, the limitation was very different under NT than it was under
Win95.

Also if it matters, the way we ultimately solved the problem (a royal PITA,
believe me) was to take all menus off the child forms, and to move all menus
and menu-processing logic into the MDI parent form, along with a bucket-load
of logic to dynamically modify the menuitems' visibility when the different
child forms got loaded or unloaded or got focus. It wasn't pretty, but we
were eventually able to load over 100 child forms before we got tired of
testing it.

Hope this helps!

Quote:

>Hello;

>With Visual Basic version 4.0 (16 && 32) and 5.0 I have memory problems
>with an MDI based application. I use the SET xxx = NEW ChildFormName to
>generate new childforms, then try to reference any control or variable
>on the form.

>After creating about 20 child forms the application return an out of
>memory error when referencing the form (not when creating it!!). Some
>error handling is present so the application will run on. The strange
>thing is that when again trying to create childforms, it will just
>work!!. However when unloading the childforms the application will
>crash, taking the VB IDE with it.

>The child form hosts an SSTAB, some SSPANEL (loaded with shapes, labels
>and lines) and  some GRAPH controls.

>Has anyone ever had the same problems or has any clue to whats
>happening,

> regards, Frank



Sat, 22 Jul 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Creating MDIChild forms at design Time

2. Setting a Form to be a MDIChild once Created

3. creating an MDIchild Form whithin other Project

4. VB5 crashes a lot ??

5. Dataenvironment crashes a LOT

6. Unload Me occasionally crashes in mdiChild

7. Dataenvironment crashes a LOT

8. Dataenvironment crashes a LOT

9. Sir-Crash-A-Lot Needs an IDE safety net

10. How to make MDIChild forms in Vb.net

11. Using MDIChild Form in VB 6

12. Generating lots of forms in VB from database

 

 
Powered by phpBB® Forum Software