检索对调试接口的进程。
HRESULT GetProcess(
IDebugProcess2 **ppProcess
);
public int GetProcess(
out IDebugProcess2 ppProcess
);
参数
- ppProcess
[out] 对调试进程接口。
返回值
如果成功,则返回; S_OK否则,返回错误代码。
示例
下面的示例演示如何执行显示 IDebugBeforeSymbolSearchEvent2 接口的 CDebugCodeContext 对象的方法。
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;
}