Hello.
I have figured out how to create an instance of an object only knowing the
type by string.
string sName = "MyClassNam e";
Type t = Type.GetType(sN ame);
Object objNew = Activator.Creat eInstance(t);
This works, but now I need to declare an array like
Object[] objNew = Activator.Creat eInstance(t)[0];
This doesn't work. Can anyone help?
Thanks.
Matthew Wells
Matthew.Wells@F irstByte.net
I have figured out how to create an instance of an object only knowing the
type by string.
string sName = "MyClassNam e";
Type t = Type.GetType(sN ame);
Object objNew = Activator.Creat eInstance(t);
This works, but now I need to declare an array like
Object[] objNew = Activator.Creat eInstance(t)[0];
This doesn't work. Can anyone help?
Thanks.
Matthew Wells
Matthew.Wells@F irstByte.net
Comment