Hello All,
I'm haveing a problem instantiating a form. When I try to instantiate
my form and call it's ShowDialog() method, I get the following error
message:
An unhandled exception of type 'System.ComponentModel.Win32Exception'
occurred in system.windows.forms.dll
Additional information: Error creating window handle.
Dim frm As New modMastController.frmSubClass
frm.ShowDialog()
Here's the Form Code:
__________________________________________________ ___________
Public Class frmSubClass
Inherits System.Windows.Forms.Form
Public Event UserMessage(ByVal uMsg As System.Int32, ByVal
wParam As System.Int32, ByVal lParam As System.Int32)
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As
Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
'frmMain
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(424, 253)
Me.Name = "frmSubClass"
Me.Text = ""
Me.ResumeLayout(False)
End Sub
#End Region
Public Const WM_APP As System.Int32 = &H8000&
#Region "Subclassing Current Form Only"
Protected Overrides Sub WndProc(ByRef m As Message)
If (m.Msg > WM_APP) Then
RaiseEvent UserMessage(m.Msg, m.WParam.ToInt32,
m.LParam.ToInt32)
End If
End Sub
#End Region
End Class
__________________________________________________ ________________
I have no idea what I'm doing wrong. Any ideas? Thanks!
-Joel