NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Activator.CreateInstance (Type, Object[])

Creates an instance of a specified type using the specified constructor. The constructor that is to be invoked must be accessible and provide the most specific match with the specified argument list, under the constraints of the default binder.

[Visual Basic]
Overloads Public Shared Function CreateInstance( _
   ByVal type As Type, _
   ByVal args() As Object _
) As Object
[C#]
public static object CreateInstance(
   Type type,
   object[] args
);
[C++]
public: static Object* CreateInstance(
   Type* type,
   Object* args[]
);
[JScript]
public static function CreateInstance(
   type : Type,
   args : Object[]
) : Object;

Parameters

type
The Type designator for the desired object.
args
[To be supplied.]

Return Value

A reference to the newly created object.

Exceptions

Exception Type Condition
AccessException The caller does not have sufficient permissions to call this method.

An element of args does not meet the contract of the constructor being invoked.

TargetInvocationException The constructor being called throws an exception.

See Also

Activator Class | Activator Members | System Namespace | Activator.CreateInstance Overload List