Bagikan melalui


IDebugCodeContext3::GetProcess

Mengambil referensi ke antarmuka proses debug.

Sintaks

public int GetProcess(
    out IDebugProcess2 ppProcess
);

Parameter

ppProcess
[out] Referensi ke antarmuka proses 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::GetProcess(IDebugProcess2** ppProcess)
{
    HRESULT hr = S_OK;
    CComPtr<CDebugEngine> pEngine;
    CComPtr<IDebugPort2> pPort2;

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

    IfFalseGo( m_pProgram, E_FAIL );
    IfFailGo( ((CDebugProgram *)m_pProgram)->GetEngine(&pEngine) );
    IfFailGo( pEngine->GetSDMProcess(ppProcess) );

Error:

    return hr;
}

Baca juga