Marshal.QueryInterface(IntPtr, Guid, IntPtr) メソッド
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
COM オブジェクトから指定したインターフェイスへのポインターを要求します。
public:
static int QueryInterface(IntPtr pUnk, Guid % iid, [Runtime::InteropServices::Out] IntPtr % ppv);
[System.Security.SecurityCritical]
public static int QueryInterface(IntPtr pUnk, ref Guid iid, out IntPtr ppv);
public static int QueryInterface(IntPtr pUnk, in Guid iid, out IntPtr ppv);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static int QueryInterface(IntPtr pUnk, ref Guid iid, out IntPtr ppv);
public static int QueryInterface(IntPtr pUnk, ref Guid iid, out IntPtr ppv);
[<System.Security.SecurityCritical>]
static member QueryInterface : nativeint * Guid * nativeint -> int
static member QueryInterface : nativeint * Guid * nativeint -> int
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member QueryInterface : nativeint * Guid * nativeint -> int
Public Shared Function QueryInterface (pUnk As IntPtr, ByRef iid As Guid, ByRef ppv As IntPtr) As Integer
- pUnk
-
IntPtr
nativeint
照会するインターフェイス。
- iid
- Guid
要求したインターフェイスのインターフェイス ID (IID: Interface Identifier)。
- ppv
-
IntPtr
nativeint
このメソッドが返されるときに、返されたインターフェイスへの参照を格納します。
呼び出しの成功または失敗を示す HRESULT。
- 属性
メソッドは QueryInterface 、特定のインターフェイス ポインターの取得を試みる COM オブジェクトの IUnknown::QueryInterface メソッドを公開します。 COM オブジェクトで を使用 QueryInterface
することは、マネージド コードでキャスト操作を実行するのと同じです。 このメソッドを使用して オブジェクトを呼び出すと、ポインターが返される前に、インターフェイス ポインターで参照カウントがインクリメントされます。 ポインターが終了したら、常に を使用 Marshal.Release して参照カウントをデクリメントします。
IUnknown インターフェイス ポインターをIntPtr表す値を取得するには、または Marshal.GetIDispatchForObjectを呼び出Marshal.GetIUnknownForObjectMarshal.GetComInterfaceForObjectします。
製品 | バージョン |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1 |
UWP | 10.0 |
.NET に関するフィードバック
.NET はオープンソース プロジェクトです。 フィードバックを提供するにはリンクを選択します。