System.Runtime.InteropServices.Marshal.GetUniqueObjectForIUnknown Method

Creates a unique Runtime Callable Wrapper (RCW) object for a given tp://go.microsoft.com/fwlink/?LinkId=148003 interface.

Syntax

public static object GetUniqueObjectForIUnknown (IntPtr unknown)

Parameters

unknown
A managed pointer to an IUnknown interface.

Returns

A unique RCW for the specified IUnknown interface.

Remarks

The Marshal.GetUniqueObjectForIUnknown(IntPtr) method ensures that you receive a unique RCW, because it does not match an IUnknown pointer to an existing object. Use this method when you have to create a unique RCW that is not impacted by other code that calls the Marshal.ReleaseComObject(object) method.

Requirements

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