This documentation is archived and is not being maintained.

Control.EndInvoke Method

Retrieves the return value of the asynchronous operation represented by the IAsyncResult object passed.

[Visual Basic]
Public Overridable Function EndInvoke( _
   ByVal asyncResult As IAsyncResult _
) As Object Implements ISynchronizeInvoke.EndInvoke
public virtual object EndInvoke(
 IAsyncResult asyncResult
public: virtual Object* EndInvoke(
 IAsyncResult* asyncResult
public function EndInvoke(
   asyncResult : IAsyncResult
) : Object;


The IAsyncResult object that represents a specific invoke asynchronous operation, returned when calling BeginInvoke.

Return Value

The Object generated by the asynchronous operation.




Exception Type Condition
ArgumentNullException The asyncResult parameter value is a null reference (Nothing in Visual Basic).
ArgumentException The asyncResult object was not created by a preceding call of the BeginInvoke method from the same control.


If the asynchronous operation has not been completed, this function will block until the result is available.

Note   There are four methods on a control that are safe to call from any thread: Invoke, BeginInvoke, EndInvoke, and CreateGraphics. For all other method calls, you should use one of the invoke methods to marshal the call to the control's thread.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Control Class | Control Members | System.Windows.Forms Namespace | BeginInvoke | InvokeRequired | Invoke