Error when WNDPROC used in Form

maxmanzero

Member
Joined
Sep 29, 2004
Messages
12
Programming Experience
Beginner
I am writing an application that uses a comControl to talk to the super IO controller on a motherboard. Everything works fine until I include the wndproc method in the form code to process some of the wnd messages. When the wnproc is present I get the following error when the control is initialized

An unhandled exception of type 'System.ComponentModel.Win32Exception' occurred in system.windows.forms.dll
Additional information: Error creating window handle.

Can anyone help me?
 
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)

Debug.WriteLine("In wndproc")

End Sub

If this code is anywhere in my main form when I call mainFrm.Show() it throws the
"Error Cannot get windows handle"
 
Hi

Try this one:

Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
Debug.WriteLine("In wndproc")​
MyBase.WndProc(m)
End Sub

Found at Microsoft MSDN.....:)
 
Back
Top