共用方式為


IDebugHost::GetHostDefinedInterface 方法 (dbgmodel.h)

如果給定主機存在,GetHostDefinedInterface 方法會傳回主機的主要私人介面。 針對 Windows 的偵錯工具,這裡傳回的介面是 IDebugClient(轉換成 IUnknown)。

語法

HRESULT GetHostDefinedInterface(
  IUnknown **hostUnk
);

參數

hostUnk

偵錯主機的核心私人介面會在這裡傳回。 針對 Windows 的偵錯工具,這是 IDebugClient 介面。

傳回值

此方法會傳回表示成功或失敗的 HRESULT。 沒有想要公開給數據模型用戶端的私人介面的主機,可能會在這裡傳回E_NOTIMPL。

言論

程式代碼範例

ComPtr<IDebugHost> spHost; /* get the debug host */

// Get the debug host private interface back from the host interfaces.  
// This is **HOST SPECIFIC**
ComPtr<IUnknown> spPrivate;
if (SUCCEEDED(spHost->GetHostDefinedInterface(&spPrivate)))
{
    // As an example, consider DbgEng:
    ComPtr<IDebugClient> spClient;
    if (SUCCEEDED(spPrivate.As(&spClient)))
    {
        // spClient now contains a DbgEng IDebugClient!
    }
}

要求

要求 價值
標頭 dbgmodel.h

另請參閱

IDebugHost 介面