System.Runtime.InteropServices.Marshal.GetIDispatchForObjectInContext Method

Returns an IDispatch interface pointer from a managed object, if the caller is in the same context as that object.

Syntax

public static IntPtr GetIDispatchForObjectInContext (object o)

Parameters

o
The object whose IDispatch interface is requested.

Returns

The IDispatch interface pointer for the specified object, or null if the caller is not in the same context as the specified object.

Remarks

This method is the same as Marshal.GetIDispatchForObject(object) except that it returns null if the caller is not in the same context as the object.

Requirements

Namespace: System.Runtime.InteropServices
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0