Export (0) Print
Expand All

Delegate.DynamicInvoke Method

Dynamically invokes (late-bound) the method represented by the current delegate.

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

public:
Object^ DynamicInvoke (
	... array<Object^>^ args
)
public Object DynamicInvoke (
	Object[] args
)
public function DynamicInvoke (
	... args : Object[]
) : Object

Parameters

args

An array of objects that are the arguments to pass to the method represented by the current delegate.

-or-

a null reference (Nothing in Visual Basic), if the method represented by the current delegate does not require arguments.

Return Value

The object returned by the method represented by the delegate.

Exception typeCondition

MemberAccessException

The caller does not have access to the method represented by the delegate (for example, if the method is private).

-or-

The number, order, or type of parameters listed in args is invalid.

TargetException

The method represented by the delegate is an instance method and the target object is a null reference (Nothing in Visual Basic).

-or-

The method represented by the delegate is invoked on an object or a class that does not support it.

TargetInvocationException

One of the encapsulated methods throws an exception.

This method calls the DynamicInvokeImpl method.

Windows 98, Windows 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 .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft