IDebugBreakpointResolution2::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 type of the breakpoint represented by this resolution.

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 specifies the type of this breakpoint.

Return Value

If successful, returns S_OK; otherwise returns an error code. Returns E_FAIL if the bpResLocation field in the associated BP_RESOLUTION_INFO structure is not valid.

Remarks

The breakpoint may be a code or a data breakpoint, for example.

Example

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

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

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

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

    return hr;
}

See also