L
Lee Moody
I'm using the following code to load a form based on the
name of the form:
Dim myType As Type = Type.GetType("SysName.CallingForm")
Dim myForm As Object = System.Activator.CreateInstance _
(myType)
myForm.mdiparent = MainMDIForm
myType.GetMethod("Show").Invoke(myForm, Nothing)
After it executes I get the following error:
An unhandled exception of type
'System.Reflection.TargetInvocationException' occurred
in mscorlib.dll
Additional information: Exception has been thrown by
the target of an invocation.
I've used this particular type of code in a few places
within my application and it works fine. I can't see
anything wrong to determine why this isn't working here.
I was hoping maybe someone on the form has seen a problem
similar to this and can point me in the right direction.
Thanks
-Lee
name of the form:
Dim myType As Type = Type.GetType("SysName.CallingForm")
Dim myForm As Object = System.Activator.CreateInstance _
(myType)
myForm.mdiparent = MainMDIForm
myType.GetMethod("Show").Invoke(myForm, Nothing)
After it executes I get the following error:
An unhandled exception of type
'System.Reflection.TargetInvocationException' occurred
in mscorlib.dll
Additional information: Exception has been thrown by
the target of an invocation.
I've used this particular type of code in a few places
within my application and it works fine. I can't see
anything wrong to determine why this isn't working here.
I was hoping maybe someone on the form has seen a problem
similar to this and can point me in the right direction.
Thanks
-Lee