Edit

Share via


IDebugBreakpointErrorEvent2::GetErrorBreakpoint

Gets an IDebugErrorBreakpoint2 object that describes the reason why a breakpoint was not bound.

Syntax

int GetErrorBreakpoint( 
    out IDebugErrorBreakpoint2 ppErrorBP
);

Parameters

ppErrorBP
[out] Returns an IDebugErrorBreakpoint2 object that describes the warning or error.

Return Value

If successful, returns S_OK; otherwise, returns an error code.

Remarks

After the IDebugErrorBreakpoint2 interface is obtained, call the GetBreakpointResolution method to get an IDebugErrorBreakpointResolution2 object. Then the GetResolutionInfo method can be used to determine an invalid location, an invalid expression, or reasons why the pending breakpoint was not bound, such as code not loaded yet, and so on.

Example

The following example shows how to implement this method for a CBreakpointSetDebugEventBase object that exposes the IDebugBreakpointErrorEvent2 interface.

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 );
}

See also