Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

_Assembly::CreateInstance Method (String^, Boolean, BindingFlags, Binder^, array<Object^>^, CultureInfo^, array<Object^>^)

 

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

Namespace:   System.Runtime.InteropServices
Assembly:  mscorlib (in mscorlib.dll)

Object^ CreateInstance(
	String^ typeName,
	bool ignoreCase,
	BindingFlags bindingAttr,
	Binder^ binder,
	array<Object^>^ args,
	CultureInfo^ culture,
	array<Object^>^ activationAttributes
)

Parameters

typeName
Type: System::String^

The Type::FullName of the type to locate.

ignoreCase
Type: System::Boolean

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

bindingAttr
Type: System.Reflection::BindingFlags

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

binder
Type: System.Reflection::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
Type: array<System::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
Type: System.Globalization::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
Type: array<System::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)

Return Value

Type: System::Object^

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

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.

.NET Framework
Available since 1.1
Return to top
Show:
© 2017 Microsoft