_Assembly.CreateInstance _Assembly.CreateInstance _Assembly.CreateInstance _Assembly.CreateInstance Method

Definition

Provides COM objects with version-independent access to the CreateInstance methods.

Overloads

CreateInstance(String) CreateInstance(String) CreateInstance(String) CreateInstance(String)

Provides COM objects with version-independent access to the CreateInstance(String) method.

CreateInstance(String, Boolean) CreateInstance(String, Boolean) CreateInstance(String, Boolean) CreateInstance(String, Boolean)

Provides COM objects with version-independent access to the CreateInstance(String, Boolean) method.

CreateInstance(String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[]) CreateInstance(String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[]) CreateInstance(String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[])

Provides COM objects with version-independent access to the CreateInstance(String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[]) method.

Remarks

This method is for access to managed classes from unmanaged code, and should not be called from managed code.

The CreateInstance methods locate a type from this assembly and create an instance of it using the system activator.

CreateInstance(String) CreateInstance(String) CreateInstance(String) CreateInstance(String)

Provides COM objects with version-independent access to the CreateInstance(String) method.

public:
 System::Object ^ CreateInstance(System::String ^ typeName);
public object CreateInstance (string typeName);
abstract member CreateInstance : string -> obj
Public Function CreateInstance (typeName As String) As Object

Parameters

typeName
String String String String

The FullName of the type to locate.

Returns

An instance of Object representing the type, with culture, arguments, binder, and activation attributes set to null, and BindingFlags set to Public or Instance, or null if typeName is not found.

Remarks

This method is for access to managed classes from unmanaged code, and should not be called from managed code.

The CreateInstance method locates the specified type from this assembly and creates an instance of it using the system activator, using case-sensitive search.

See also

CreateInstance(String, Boolean) CreateInstance(String, Boolean) CreateInstance(String, Boolean) CreateInstance(String, Boolean)

Provides COM objects with version-independent access to the CreateInstance(String, Boolean) method.

public:
 System::Object ^ CreateInstance(System::String ^ typeName, bool ignoreCase);
public object CreateInstance (string typeName, bool ignoreCase);
abstract member CreateInstance : string * bool -> obj
Public Function CreateInstance (typeName As String, ignoreCase As Boolean) As Object

Parameters

typeName
String String String String

The FullName of the type to locate.

ignoreCase
Boolean Boolean Boolean Boolean

true to ignore the case of the type name; otherwise, false.

Returns

An instance of Object representing the type, with culture, arguments, binder, and activation attributes set to null, and BindingFlags set to Public or Instance, or null if typeName is not found.

Remarks

This method is for access to managed classes from unmanaged code, and should not be called from managed code.

The CreateInstance method locates the specified type from this assembly and creates an instance of it using the system activator, with optional case-sensitive search.

See also

CreateInstance(String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[]) CreateInstance(String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[]) CreateInstance(String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[])

Provides COM objects with version-independent access to the CreateInstance(String, Boolean, BindingFlags, Binder, Object[], CultureInfo, Object[]) method.

public:
 System::Object ^ CreateInstance(System::String ^ typeName, bool ignoreCase, System::Reflection::BindingFlags bindingAttr, System::Reflection::Binder ^ binder, cli::array <System::Object ^> ^ args, System::Globalization::CultureInfo ^ culture, cli::array <System::Object ^> ^ activationAttributes);
public object CreateInstance (string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, object[] args, System.Globalization.CultureInfo culture, object[] activationAttributes);
abstract member CreateInstance : string * bool * System.Reflection.BindingFlags * System.Reflection.Binder * obj[] * System.Globalization.CultureInfo * obj[] -> obj

Parameters

typeName
String String String String

The FullName of the type to locate.

ignoreCase
Boolean Boolean Boolean Boolean

true to ignore the case of the type name; otherwise, false.

bindingAttr
BindingFlags BindingFlags BindingFlags BindingFlags

A bitmask that affects how the search is conducted. The value is a combination of bit flags from BindingFlags.

binder
Binder Binder Binder Binder

An object that enables the binding, coercion of argument types, invocation of members, and retrieval of MemberInfo objects via reflection. If binder is null, the default binder is used.

args
Object[]

An array of type Object containing the arguments to be passed to the constructor. This array of arguments must match in number, order, and type the parameters of the constructor to be invoked. If the default constructor is desired, args must be an empty array or null.

culture
CultureInfo CultureInfo CultureInfo CultureInfo

An instance of CultureInfo used to govern the coercion of types. If this is null, the CultureInfo for the current thread is used. (This is necessary to convert a String that represents 1000 to a Double value, for example, since 1000 is represented differently by different cultures.)

activationAttributes
Object[]

An array of type Object containing one or more activation attributes that can participate in the activation. An example of an activation attribute is:

URLAttribute(http://hostname/appname/objectURI)

Returns

An instance of Object representing the type and matching the specified criteria, or null if typeName is not found.

Remarks

This method is for access to managed classes from unmanaged code, and should not be called from managed code.

The CreateInstance method locates the specified type from this assembly and creates an instance of it using the system activator, with optional case-sensitive search and having the specified culture, arguments, and binding and activation attributes.

See also

Applies to