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.

Delegate.DynamicInvoke Method

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

[Visual Basic]
Public Function DynamicInvoke( _
   ByVal args() As Object _
) As Object
[C#]
public object DynamicInvoke(
 object[] args
);
[C++]
public: Object* DynamicInvoke(
 Object* args __gc[]
);
[JScript]
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.

Exceptions

Exception Type Condition
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.

Remarks

This method calls the DynamicInvokeImpl method.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Common Language Infrastructure (CLI) Standard

.NET Framework Security: 

See Also

Delegate Class | Delegate Members | System Namespace | DynamicInvokeImpl | Object

Show:
© 2015 Microsoft