something like
dim objType as Type = Type.GetType("CustomerObject")
dim objConstructor as ConstructorInfo =
objType.GetConstructor(Type.EmptyTypes)
dim obj as Object = objConstructor.Invoke(Nothing)
note: "CustomerObject" must be "full qualified"
so if that object is in nameSpace MyNamespace you should do:
dim objType as Type = Type.GetType("MyNamespace.CustomerObject")
hope this helps
dominique
"Mariano" <an*******@discussions.microsoft.com> wrote in message
news:EC**********************************@microsof t.com...
Hi,
I have stored a menu in a database. The menu is dynamically updated and
last level menu items contain the object type that should be instantiated. I
am looking for a way to instantiate the object dynamically without an
enormous select case statement. I can't find nothing in the docs... Any
ideas?
To make things clear, what I want to do is something like this:
dim objType as new String("CustomerObject")
dim obj as new objType
All instantiated objects have new() constructors.
Mariano.