Error creating window handle - possible causes?

  • Thread starter Thread starter illegal.prime
  • Start date Start date
I

illegal.prime

So I've taken a perusal through google groups looking for possible
causes of this error.

I've seen answers varying from:
- creating too many Form objects
- creating too many MenuItems in your Forms
- a combination of the above two
- something to do with setting the style on a control

So, I'm looking through my app. to determine what the problem is and I
found a change I made recently was to add this to one of my control's
constructors:
SetStyle(
ControlStyles.UserPaint |
ControlStyles.AllPaintingInWmPaint |
ControlStyles.DoubleBuffer, true)

Could this be the cause of my new problems?

Also, what other areas should I be investigating? Since I would like
to double check the rest of my code for any other possible culprits.

Thanks,
Novice
 
Well, to those who are interested, the easiest way (doesn't require you
to buy any software, etc) to diagnose problems of this sort is just to
open task manager, go to Processes, enable the User Objects column and
possibly the Handles, Threads and GDI Objects (though my problem seems
to be in the number of User Objects).

Anyway, once you have task manager open with those columns, watch your
application as those various values increase.

This should help you determine which part of your application is
causing the problem.

I'll post further if I get any more details - but please feel free to
chime in experts.

Thanks,
Novice
 
Hi, I have a killing problem with "Error creating window handle". I have this mdiContainer and sometimes when I add a form to the container, at the Show() method I get this error. If I don't set this form as mdi everything goes great. But that is unacceptable.


So what causes this error? I work in .NET 2005 and in .NET 1.0 everythig worked perfectly.
 
Back
Top