共用方式為


IDebugBoundBreakpoint2::Delete

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

Deletes the breakpoint.

Syntax

HRESULT Delete( 
    void 
);
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