Another:
How to create instance of an known
Type?
Type.GetInstance() - somethink like that ...
Hans Kesting - 08 Nov 2007 10:29 GMT
Jacek Jurkowski laid this down on his screen :
> Another:
>
> How to create instance of an known
> Type?
>
> Type.GetInstance() - somethink like that ...
that's Activator.CreateInstance(myType) and various overloads.
Hans Kesting
> Reflect an assembly (current dll) and create
> instance object of every class which base
> clas is "Module"?
Assembly a.s = GetType().Assembly;
foreach(Type tp in a.s.GetTypes())
{
if(!typeof(Module).IsAssignableFrom(tp))
continue;
Module o = (Module)Activator.CreateInstance(tp, true);
}
HTH,
Andy

Signature
You can email me by removing the NOSPAM parts below:
xmen40NOSPAM@gmxNOSPAM.net