PDA

Click to See Complete Forum and Search --> : Error creating window handle.


venerable bede
Oct 21st, 2002, 11:24 AM
I use the following code to open a winform:

Dim abForm As New frmArchive()
abForm.MdiParent = Me
abForm.Show()

The problem I have is that when i run the code I get
" Error creating window handle."

I use the above 3 lines all the time and have never had problems in the past,

Any Ideas Anyone

Thanks in Advance

hellswraith
Oct 21st, 2002, 12:41 PM
I have found that odd errors occur when you are trying to create an show a form that has errors in it. You know the code works, so the first place I would go would be to the form's constructor or load event. Step through that code as the form is being created and shown. You will most likely find your problem there.

I was having some really wierd errors with this code (C#):
FormMain f = new FormMain();
f.ShowDialog(this);
The compiler kept telling me there was a problem with that code, but the problem was really in the FormMain class's constructor. I knew that code worked because I used it to show dialogs all the time. Just thatone time it kept thowing an error.