Saturday, October 23, 2004

Activator.CreateInstance() Method

Activator is a class in System namespace...

This class is one of the most widely used class to create instances at runtime, of types locally or remotely defined...

Usually it returns back an object or an objecthandle...
There are lots of overloads of this method and in local scenarios mostly take System.Type() as one of the parameter...

Its certain overloads also take typename as string and return back an object handle...
This objecthandle then needs to be unwrapped to get back the object...
The overload which returns objecthandle is mostly used in Remoting...

CreateInstance is a static member of the class and so can be accessed directly without object creation...

With Best Regards,
Mitesh Mehta
Email : miteshvmehta@gmail.com
http://cc.1asphost.com/miteshvmehta/

No comments: