Page 1 of 1

Failed to load

Posted: 10 Sep 2012, 12:38
by Mex
Hi Timo!

You have "deeper" experiences with VB6 and controls :)

I have a MDI application. When user (i dont know why) opens 20 or more child forms, following error happens
'Failed to load control 'ImageList' from mscomctl.OCX. Your version of mscomctl.OCX may be outdated. Make sure you are using the version of the control that was provided with your application.' (372).
I't seems this error happens only with XP. Tested with Win7, app. gets very slow of course, but no error.

Do you know why this happens and how to avoid this?

Best regards;

Re: Failed to load

Posted: 10 Sep 2012, 19:50
by TiKu

as you mentioned that the system becomes slow, I could imagine that it runs out of resources. You should open task manager and watch the number of USER objects and GDI objects for your program's process. Especially the number of GDI objects is probably very high (several thousand). As far as I know Windows Vista and newer can handle more GDI objects.

As a workaround you could try using API-based image lists instead. Of course this will require lots of work.

/Edit: You should also check for memory leaks. At work we've also a VB6 MDI application with tons of children. For a while we had problems with non-obvious circle references between UserControls and Forms which have been caused by the UserControls and some helper classes. The result was that most MDI childs got unloaded only partly, i.e. you did not see them anymore and as far as I remember they no longer appeared in the Forms collection, but they were still in memory (you could see it in task manager).