System.Runtime.Remoting.Proxies.RealProxy.GetCOMIUnknown Method

Requests an unmanaged reference to the object represented by the current proxy instance.

Syntax

public virtual IntPtr GetCOMIUnknown (bool fIsMarshalled)

Parameters

fIsMarshalled
true if the object reference is requested for marshaling to a remote location; false if the object reference is requested for communication with unmanaged objects in the current process through COM.

Returns

A pointer to a [<topic://cpconcomcallablewrapper>] if the object reference is requested for communication with unmanaged objects in the current process through COM, or a pointer to a cached or newly generated IUnknown COM interface if the object reference is requested for marshaling to a remote location.

Remarks

If the proxy is requested for marshaling, then an IUnknown interface for the object represented by the current proxy instance is returned. If an IUnknown was previously cached by the RealProxy.SetCOMIUnknown(IntPtr) method, then that instance is returned; otherwise, a new instance is returned.

If the proxy is requested not for marshaling but for communication with unmanaged objects in the current process, then a [<topic://cpconcomcallablewrapper>] (CCW), which can be used in the current process for communication through COM, is returned.

Requirements

Namespace: System.Runtime.Remoting.Proxies
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0