System.Runtime.InteropServices.Marshal.GetIUnknownForObjectInContext Method

Returns an tp://go.microsoft.com/fwlink/?LinkId=148003 interface from a managed object, if the caller is in the same context as that object.

Syntax

public static IntPtr GetIUnknownForObjectInContext (object o)

Parameters

o
The object whose IUnknown interface is requested.

Returns

The IUnknown 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.GetIUnknownForObject(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