Error creating window handle - possible causes?

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
 
I

illegal.prime

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
 
I

irinas

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top