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, BindingFlags, Binder, Object[], CultureInfo, Object[])

Creates an instance of the 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 specified binder and binding attributes.

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

Parameters

type
The Type designator for the class of object you want to create.
bindingAttr
[To be supplied.]
binder
[To be supplied.]
args
[To be supplied.]
culture
[To be supplied.]
activationAttributes
[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.
TargetInvocationException The constructor being called throws an exception.

See Also

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