This documentation is archived and is not being maintained.

AccessibleObject.IReflect.InvokeMember Method

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Invokes a specified member. For a description of this member, see IReflect.InvokeMember.

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

Object IReflect.InvokeMember(
	string name,
	BindingFlags invokeAttr,
	Binder binder,
	Object target,
	Object[] args,
	ParameterModifier[] modifiers,
	CultureInfo culture,
	string[] namedParameters


Type: System.String

The name of the member to find.

Type: System.Reflection.BindingFlags

One of the System.Reflection.BindingFlags invocation attributes.

Type: System.Reflection.Binder

One of the System.Reflection.BindingFlags bit flags. Implements Binder, containing properties related to this method.

Type: System.Object

The object on which to invoke the specified member. This parameter is ignored for static members.

Type: System.Object[]

An array of objects that contains the number, order, and type of the parameters of the member to be invoked. This is an empty array if there are no parameters.

Type: System.Reflection.ParameterModifier[]

An array of System.Reflection.ParameterModifier objects.

Type: System.Globalization.CultureInfo

An instance of System.Globalization.CultureInfo used to govern the coercion of types.

Type: System.String[]

A String array of parameters.

Return Value

Type: System.Object
The specified member.


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


invokeAttr is BindingFlags.CreateInstance and another bit flag is also set.


invokeAttr is not BindingFlags.CreateInstance and name is null.


invokeAttr is not an invocation attribute from System.Reflection.BindingFlags.


invokeAttr specifies both get and set for a property or field.


invokeAttr specifies both a field set and an Invoke method. args is provided for a field get operation.


More than one argument is specified for a field set operation.


The field or property cannot be found.


The method cannot be found.


A private member is invoked without the necessary System.Security.Permissions.ReflectionPermission.

The invokeAttr parameter may be a constructor, method, property, or field. A suitable invocation attribute must be specified. Invoke the default member of a class by passing the empty string ("") as the name of the member.

The modifiers parameter has the same length as the args parameter, representing the invoked member's argument attributes in the metadata. A parameter can have the following attributes: pdIn, pdOut, pdRetval, pdOptional, and pdHasDefault. These represent [In], [Out], [retval], [optional], and a default parameter, respectively.

This member is an explicit interface member implementation. It can be used only when the AccessibleObject instance is cast to an IReflect interface.

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

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0