다음을 통해 공유


IDebugPendingBreakpoint2::Delete

보류 중인 이 중단점과 해당 중단점에서 바인딩된 모든 중단점을 삭제합니다.

구문

int Delete();

Return Value

성공하면 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;
}

참고 항목