IDebugBreakpointErrorEvent2::GetErrorBreakpoint
如需 Visual Studio 2017 的最新文件請參閱 Visual Studio 2017 文件。
取得IDebugErrorBreakpoint2原因為何中斷點未繫結的物件。
語法
HRESULT GetErrorBreakpoint(
IDebugErrorBreakpoint2** ppErrorBP
);
int GetErrorBreakpoint(
out IDebugErrorBreakpoint2 ppErrorBP
);
參數
ppErrorBP
[out]傳回IDebugErrorBreakpoint2物件,描述警告或錯誤。
傳回值
如果成功,傳回S_OK
; 否則傳回錯誤碼。
備註
之後IDebugErrorBreakpoint2
介面取得,請呼叫GetBreakpointResolution方法來取得IDebugErrorBreakpointResolution2物件。 然後在GetResolutionInfo方法可用來判斷不正確的位置、 運算式無效或原因為何暫止中斷點未繫結,例如,未載入的程式碼等等。
範例
下列範例示範如何實作這個方法的CBreakpointSetDebugEventBase公開物件IDebugBreakpointErrorEvent2介面。
STDMETHODIMP CBreakpointErrorDebugEventBase::GetErrorBreakpoint(
IDebugErrorBreakpoint2 **ppbp)
{
HRESULT hRes = E_FAIL;
if ( ppbp )
{
if ( m_pError )
{
*ppbp = m_pError;
m_pError->AddRef();
hRes = S_OK;
}
else
hRes = E_FAIL;
}
else
hRes = E_INVALIDARG;
return ( hRes );
}
另請參閱
IDebugBreakpointErrorEvent2
IDebugErrorBreakpointResolution2
IDebugErrorBreakpoint2