Edit

Share via


IDebugBoundBreakpoint2::Delete

Deletes the breakpoint.

Syntax

int Delete();

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

Example

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

HRESULT CBoundBreakpoint::Delete(void)
{
    HRESULT hr;

    // Verify that the bound breakpoint has not been
    // deleted. If deleted, then return hr = E_BP_DELETED.
    if (m_state != BPS_DELETED)
    {
        m_pInterp->RemoveBreakpoint(m_sbstrDoc, this);

        // Change the state of the breakpoint to BPS_DELETED.
        m_state = BPS_DELETED;
        hr = S_OK;
    }
    else
    {
        hr = E_BP_DELETED;
    }

    return hr;
}

See also