IDebugBoundBreakpoint2::Delete
如需 Visual Studio 2017 的最新文件請參閱 Visual Studio 2017 文件。
刪除中斷點。
語法
HRESULT Delete(
void
);
int Delete();
傳回值
如果成功,傳回S_OK
; 否則傳回錯誤碼。 傳回E_BP_DELETED
如果繫結的中斷點物件的狀態設定為BPS_DELETED
(屬於BP_STATE列舉型別)。
範例
下列範例示範如何實作這種簡單的方式CBoundBreakpoint
公開物件IDebugBoundBreakpoint2介面。
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;
}