Error creating window handle

87 views
Skip to first unread message

JosR

unread,
Jun 6, 2005, 11:31:55 AM6/6/05
to DotNetDe...@googlegroups.com
Using: VB.Net, Framework 1.1, Windows XP SP2
Hardware: Pentium IV 3,1 GHz, 1 Gb RAM memory

The VB.Net application opens a child form as follows:

Private Sub OpenChildForm()
dim frm as new frmWhatever
frm.showdialog()
frm.dispose()
End Sub

I can open the child form several times without a problem. But at a
given moment I get an "Error creating window handle". The error occurs
at the 20th (or so) consecutive call of the OpenChildForm procedure.
I understand that Windows 9x has a limited number of handles, but since
I'm using Windows XP that shouldn't be the problem.

Reading the newsgroups I found out I'm not the only one having this
problem. Unfortunately, I haven't seen a solution either.

Any help would be appreciated.

Hal

unread,
Jun 6, 2005, 12:04:38 PM6/6/05
to DotNetDe...@googlegroups.com
I believe XP also has a handle limit, but it is really high so I still
wouldn't think that would be the issue. I did find some chatter
regarding databinding problems on the childform as well as and a post
over at GDN message boards containing:
<snip>
Interestingly i've just resolved that issue myself today. And in the
spirit of not being hypocritical, here's what was wrong in my code. It
might not be the same as what was happening with you.

It actually turned out to be a NullReferenceException in the form's
OnLoad, which for some unknown reason always gets converted to a
SystemOutOfMemory exception. I was also told that this behaviour is the
same for any exceptions occurring in the form's constructor.

So basicly, a control disappeared somewhere and cause the problem.
Pretty easy to fix, but a nightmare to identify.
</snip>

But who knows if that is the case :-)... Wish I could be of more help,
and please post if you do find an answer to your problem.

Best regards,

Hal

Reply all
Reply to author
Forward
0 new messages