Bagikan melalui


IDebugCodeContext3::GetModule

Mengambil referensi ke antarmuka modul debug.

Sintaks

public int GetModule(
    out IDebugModule2 ppModule
);

Parameter

ppModule
[out] Referensi ke antarmuka modul debug.

Tampilkan Nilai

Jika berhasil, mengembalikan S_OK; jika tidak, mengembalikan kode galat.

Contoh

Contoh berikut menunjukkan cara menerapkan metode ini untuk objek CDebugCodeContext yang mengekspos antarmuka IDebugBeforeSymbolSearchEvent2 .

HRESULT CDebugCodeContext::GetModule(IDebugModule2** ppModule)
{
    HRESULT hr = S_OK;
    CComPtr<CModule> pModule;

    IfFalseGo( ppModule, E_INVALIDARG );
    *ppModule = NULL;

    IfFailGo( this->GetModule(&pModule) );
    IfFailGo( pModule->QueryInterface(IID_IDebugModule2, (void**) ppModule) );

Error:

    return hr;
}

Baca juga