Compartilhar via


IDebugPendingBreakpoint2::Delete

Exclui esse ponto de interrupção pendente e todos os pontos de interrupção vinculados a ele.

Sintaxe

int Delete();

Valor de retorno

Se tiver êxito, retornará S_OK. Caso contrário, retornará um código de erro. Retorna E_BP_DELETED se o ponto de interrupção tiver sido excluído.

Exemplo

O exemplo a seguir mostra como implementar esse método para um objeto simples CPendingBreakpoint que implementa a interface IDebugPendingBreakpoint2 .

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

Confira também