IDebugBoundBreakpoint2::Delete

删除断点。

语法

int Delete();

返回值

如果成功,则返回 S_OK;否则,返回错误代码。 返回E_BP_DELETED绑定断点对象的状态是否设置为BPS_DELETED(BP_STATE 枚举的一部分)。

示例

以下示例演示如何为公开 IDebugBoundBreakpoint2 接口的简单CBoundBreakpoint对象实现此方法。

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;
}

另请参阅