Marshal.GetUniqueObjectForIUnknown(IntPtr) 方法
定义
为给定的 IUnknown 接口创建唯一的运行时可调用包装器 (RCW) 对象。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
参数
- unknown
- IntPtr
指向 IUnknown 接口的托管指针。A managed pointer to an IUnknown interface.
返回
指定的 IUnknown 接口的唯一 RCW。A unique RCW for the specified IUnknown interface.
- 属性
注解
GetUniqueObjectForIUnknown方法确保接收到唯一的 RCW,因为它不匹配 IUnknown 指向现有对象的指针。The GetUniqueObjectForIUnknown method ensures that you receive a unique RCW, because it does not match an IUnknown pointer to an existing object. 当必须创建不受调用方法的其他代码影响的唯一 RCW 时,可使用此方法 ReleaseComObject 。Use this method when you have to create a unique RCW that is not impacted by other code that calls the ReleaseComObject method.