次の方法で共有


IDebugPendingBreakpoint2::Delete

この保留中のブレークポイントと、そこからバインドされているすべてのブレークポイントを削除します。

構文

int Delete();

戻り値

成功した場合は、S_OK を返します。それ以外の場合は、エラー コードを返します。 ブレークポイントが削除されている場合は、E_BP_DELETED を返します。

次の例は、IDebugPendingBreakpoint2 インターフェイスを実装するシンプルな CPendingBreakpoint オブジェクトにこのメソッドを実装する方法を示しています。

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

    // Verify that the pending breakpoint has not been deleted. If deleted,
    // then return hr = E_BP_DELETED.
    if (m_state.state != PBPS_DELETED)
    {
        // If the pending breakpoint has bound and has an associated bound
        // breakpoint, delete and release the bound breakpoint and set the
        // pointer to NULL.
        if (m_pBoundBP)
        {
            m_pBoundBP->Delete();
            m_pBoundBP->Release();
            m_pBoundBP = NULL;
        }
        // If the pending breakpoint did not bind and has an associated
        // error breakpoint, release the error breakpoint and set the
        // pointer to NULL.
        if (m_pErrorBP)
        {
            m_pErrorBP->Release();
            m_pErrorBP = NULL;
        }

        // Set the PENDING_BP_STATE in the PENDING_BP_STATE_INFO structure
        // to deleted.
        m_state.state = PBPS_DELETED;
    }
    else
    {
        hr = E_BP_DELETED;
    }

    return hr;
}

関連項目