This documentation is archived and is not being maintained.

_Type.InvokeMember Method (String, BindingFlags, Binder, Object, Object[], ParameterModifier[], CultureInfo, String[])

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

This method is not CLS-compliant.  

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

Object InvokeMember (
	string name,
	BindingFlags invokeAttr,
	Binder binder,
	Object target,
	Object[] args,
	ParameterModifier[] modifiers,
	CultureInfo culture,
	string[] namedParameters
)
Object InvokeMember (
	String name, 
	BindingFlags invokeAttr, 
	Binder binder, 
	Object target, 
	Object[] args, 
	ParameterModifier[] modifiers, 
	CultureInfo culture, 
	String[] namedParameters
)
function InvokeMember (
	name : String, 
	invokeAttr : BindingFlags, 
	binder : Binder, 
	target : Object, 
	args : Object[], 
	modifiers : ParameterModifier[], 
	culture : CultureInfo, 
	namedParameters : String[]
) : Object
Not applicable.

Parameters

name

The String containing the name of the constructor, method, property, or field member to invoke.

-or-

An empty string ("") to invoke the default member.

-or-

For IDispatch members, a string representing the DispID, for example "[DispID=3]".

invokeAttr

A bitmask comprised of one or more BindingFlags that specify how the search is conducted. The access can be one of the BindingFlags such as Public, NonPublic, Private, InvokeMethod, GetField, and so on. The type of lookup need not be specified. If the type of lookup is omitted, BindingFlags.Public | BindingFlags.Instance will apply.

binder

A Binder object that defines a set of properties and enables binding, which can involve selection of an overloaded method, coercion of argument types, and invocation of a member through reflection.

-or-

a null reference (Nothing in Visual Basic), to use the DefaultBinder.

target

The Object on which to invoke the specified member.

args

An array containing the arguments to pass to the member to invoke.

modifiers

An array of ParameterModifier objects representing the attributes associated with the corresponding element in the args array. A parameter's associated attributes are stored in the member's signature. The default binder does not process this parameter.

culture

The CultureInfo object representing the globalization locale to use, which may be necessary for locale-specific conversions, such as converting a numeric String to a Double.

-or-

a null reference (Nothing in Visual Basic) to use the current thread's CultureInfo.

namedParameters

An array containing the names of the parameters to which the values in the args array are passed.

Return Value

An Object representing the return value of the invoked member.

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

The Type.InvokeMember method invokes the specified member, using the specified binding constraints and matching the specified argument list, modifiers, and culture.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0
Show: