IDebugBoundBreakpoint2::GetPendingBreakpoint

Gets the pending breakpoint from which the specified bound breakpoint was created.

Syntax

int GetPendingBreakpoint( 
    out IDebugPendingBreakpoint2 ppPendingBreakpoint
);

Parameters

ppPendingBreakpoint
[out] Returns the IDebugPendingBreakpoint2 object that represents the pending breakpoint that was used to create this bound breakpoint.

Return Value

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

Remarks

A pending breakpoint can be thought of as a collection of all the necessary information needed to bind a breakpoint to code that can be applied to one or many programs.

Example

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

HRESULT CBoundBreakpoint::GetPendingBreakpoint(
    IDebugPendingBreakpoint2** ppPendingBreakpoint)
{
    HRESULT hr;

    // Check for valid IDebugPendingBreakpoint2 interface pointer.
    if (ppPendingBreakpoint)
    {
        // Be sure that the bound breakpoint has not been deleted. If
        // deleted, then return hr = E_BP_DELETED.
        if (m_state != BPS_DELETED)
        {
            // Query for the IDebugPendingBreakpoint2 interface.
            hr = m_pPendingBP->QueryInterface(IID_IDebugPendingBreakpoint2,
                                              (void**)ppPendingBreakpoint);
        }
        else
        {
            hr = E_BP_DELETED;
        }
    }
    else
    {
        hr = E_INVALIDARG;
    }

    return hr;
}

See also