共用方式為


IDebugBoundBreakpoint2::GetBreakpointResolution

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

Gets the breakpoint resolution that describes this breakpoint.

Syntax

HRESULT GetBreakpointResolution( 
    IDebugBreakpointResolution2** ppBPResolution
);
int GetBreakpointResolution( 
    out IDebugBreakpointResolution2 ppBPResolution
);

Parameters

ppBPResolution
[out] Returns the IDebugBreakpointResolution2 interface that represents one of the following:

  • The breakpoint resolution object that describes the location in code where a code breakpoint has been bound.

  • The data location where a data breakpoint has bound.

Return Value

If successful, returns S_OK; otherwise, returns an error code. Returns E_BP_DELETED if the state of the bound breakpoint object is set to BPS_DELETED (part of the BP_STATE enumeration).

Remarks

Call the GetBreakpointType method to determine if the breakpoint resolution is for code or data.

Example

The following example shows how to implement this method for a simple CBoundBreakpoint object that exposes the IDebugBoundBreakpoint2 interface.

HRESULT CBoundBreakpoint::GetBreakpointResolution(
    IDebugBreakpointResolution2** ppBPResolution)
{
    HRESULT hr;

    if (ppBPResolution)
    {
        // Verify that the bound breakpoint has not been deleted. If
        // deleted, then return hr = E_BP_DELETED.
        if (m_state != BPS_DELETED)
        {
            // Query for the IDebugBreakpointResolution2 interface.
            hr = m_pBPRes->QueryInterface(IID_IDebugBreakpointResolution2,
                                          (void **)ppBPResolution);
            assert(hr == S_OK);
        }
        else
        {
            hr = E_BP_DELETED;
        }
    }
    else
    {
        hr = E_INVALIDARG;
    }

    return hr;
}

See also