Bewerken

Delen via


Marshal.GetUniqueObjectForIUnknown(IntPtr) Method

Definition

Creates a unique Runtime Callable Wrapper (RCW) object for a given IUnknown interface.

public:
 static System::Object ^ GetUniqueObjectForIUnknown(IntPtr unknown);
[System.Security.SecurityCritical]
public static object GetUniqueObjectForIUnknown (IntPtr unknown);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static object GetUniqueObjectForIUnknown (IntPtr unknown);
public static object GetUniqueObjectForIUnknown (IntPtr unknown);
[<System.Security.SecurityCritical>]
static member GetUniqueObjectForIUnknown : nativeint -> obj
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member GetUniqueObjectForIUnknown : nativeint -> obj
static member GetUniqueObjectForIUnknown : nativeint -> obj
Public Shared Function GetUniqueObjectForIUnknown (unknown As IntPtr) As Object

Parameters

unknown
IntPtr

nativeint

A managed pointer to an IUnknown interface.

Returns

A unique RCW for the specified IUnknown interface.

Attributes

Remarks

The GetUniqueObjectForIUnknown 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 ReleaseComObject method.

Applies to