Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.Net Late Binding Forms

Status
Not open for further replies.

RealQuiet

Programmer
Feb 11, 2001
54
US
I am writing an MDI application that dynamically builds a menu structure from a database. In order to do this, I need to late bind the child forms based on the menu information in the database. This is what I have so far.

Dim frmTemp as New Object
Dim asTest as System.Reflection.Assembly

asTest = System.Reflection.Assembly.Load("TestMDIFormDLL")
frmTemp = Activator.CreateInstance(a.GetType("frmTestMDI"))
frmTemp.mdiparent = Me
frmTemp.Show()

The assembly 'TestMDIFormDLL' is loaded, and frmTestMDI is a public class in that assembly, but when I try to do the GetType I get the following error:
An unhandled exception of Type 'System.ArgumentNullException' occurred in mscorlib.dll
Additional information: Value cannot be null
Any help on this would be appreciated.
 
I mistyped a line in the previous post. The fourth line should read:
frmTemp = Activator.CreateInstance(asTest.GetType("frmTestMDI"))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top