A
Andrew Backer
Hello,
I am having a problem creating a class dynamically. The class I have
is a base class of another, and the parent class has the constructor
(which takes one argument). The base class (Class1, below) does not
have any constructors. I am using code like this to create it, and
it's blowing up :
Dim res As Object = Activator.CreateInstance( _
GetType( MyNameSpace.Class1 ), _
"String Argument" _
)
Is there something I am doing wrong? It worked for simple cases with
no constructor parameters. Do I need to revert to that and just make a
setter on the class to set the properties?
Thanks,
Andrew
I am having a problem creating a class dynamically. The class I have
is a base class of another, and the parent class has the constructor
(which takes one argument). The base class (Class1, below) does not
have any constructors. I am using code like this to create it, and
it's blowing up :
Dim res As Object = Activator.CreateInstance( _
GetType( MyNameSpace.Class1 ), _
"String Argument" _
)
Is there something I am doing wrong? It worked for simple cases with
no constructor parameters. Do I need to revert to that and just make a
setter on the class to set the properties?
Thanks,
Andrew