[Mono-list] Quick C# question..

Tomas Restrepo tomasr@mvps.org
Sun, 15 Jul 2001 08:31:53 -0500


Hi Marci,
> I spent about half an hour searching through the framework docs to no
> avail and want to know if there is anything like (vaguely pseudocode
> follows) " Object foo = new CreateObject( "MyObject" )"  ie, can you
> dynamically create objects?  More practically, the string in
> CreateObject would be a variable.  I know you can do it for COM objects,
> but can you do it for managed .NET framework objects?

Yes, there is. That functionality is found in the System.Activator class,
with the bunch of CreateInstanceXXXX() methods it contains.

--
Tomas Restrepo
tomasr@mvps.org