IDebugErrorBreakpointResolution2::GetBreakpointType

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 type.

Syntax

HRESULT GetBreakpointType(
    BP_TYPE* pBPType
);
int GetBreakpointType(
    out enum_BP_TYPE pBPType
);

Parameters

pBPType
[out] Returns a value from the BP_TYPE enumeration that describes the type of breakpoint.

Return Value

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

Remarks

This method returns the type of the breakpoint that failed to bind, thus requiring an error breakpoint event.

Example

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

HRESULT CDebugErrorBreakpointResolution::GetBreakpointType(BP_TYPE* pBPType)
{
    HRESULT hr;

    if (pBPType)
    {
        // Set default BP_TYPE.
        *pBPType = BPT_NONE;

        // Check if the BPERESI_BPRESLOCATION flag is set in BPERESI_FIELDS.
        if (IsFlagSet(m_bpErrorResolutionInfo.dwFields, BPERESI_BPRESLOCATION))
        {
            // Set the new BP_TYPE.
            *pBPType = m_bpErrorResolutionInfo.bpResLocation.bpType;
            hr = S_OK;
        }
        else
        {
            hr = E_FAIL;
        }
    }
    else
    {
        hr = E_INVALIDARG;
    }

    return hr;
}

See also