IDebugBreakpointErrorEvent2::GetErrorBreakpoint
取得IDebugErrorBreakpoint2物件,描述為何中斷點未繫結的原因。
HRESULT GetErrorBreakpoint(
IDebugErrorBreakpoint2** ppErrorBP
);
int GetErrorBreakpoint(
out IDebugErrorBreakpoint2 ppErrorBP
);
參數
- ppErrorBP
[] out傳回IDebugErrorBreakpoint2 ,描述的警告或錯誤的物件。
傳回值
如果成功的話,會傳回S_OK。 否則,會傳回錯誤碼。
備註
後IDebugErrorBreakpoint2介面會取得、 呼叫IDebugErrorBreakpoint2::GetBreakpointResolution方法來取得IDebugErrorBreakpointResolution2物件。 然後在IDebugErrorBreakpointResolution2::GetResolutionInfo方法可用來判斷不正確的位置、 無效的運算式或為什麼暫止中斷點未繫結,例如不好、 載入的程式碼的原因,依此類推。
範例
下列範例會示範如何實作這個方法,如 CBreakpointSetDebugEventBase 物件,公開 (expose) 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 );
}