共用方式為


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

另請參閱