Poznámka:
Přístup k této stránce vyžaduje autorizaci. Můžete se zkusit přihlásit nebo změnit adresáře.
Přístup k této stránce vyžaduje autorizaci. Můžete zkusit změnit adresáře.
Povolí nebo zakáže zarážku.
Syntaxe
Parametry
fEnable
[v] Pokud chcete zarážku zakázat, nastavte na nenulovou hodnotu (TRUE), pokud chcete zarážku povolit nebo na nulu (FALSE).
Vrácená hodnota
V případě úspěchu vrátí hodnotu S_OK; v opačném případě vrátí kód chyby. Vrátí E_BP_DELETED , pokud je stav vázaného objektu zarážky nastaven na BPS_DELETED (část BP_STATE výčtu).
Příklad
Následující příklad ukazuje, jak implementovat tuto metodu pro jednoduchý CBoundBreakpoint objekt, který zveřejňuje IDebugBoundBreakpoint2 rozhraní.
HRESULT CBoundBreakpoint::Enable(BOOL fEnable)
{
HRESULT hr;
// Verify that the bound breakpoint has not been deleted. If deleted,
// then return hr = E_BP_DELETED.
if (m_state != BPS_DELETED)
{
// Check the state of the bound breakpoint. If the breakpoint is
// supposed to be, but has not already been, enabled, then have the
// interpreter set the breakpoint.
if (fEnable && m_state != BPS_ENABLED)
{
hr = m_pInterp->SetBreakpoint(m_sbstrDoc, this);
if (hr == S_OK)
{
// Change the state of the breakpoint to BPS_ENABLED.
m_state = BPS_ENABLED;
}
}
// Check the state of the bound breakpoint. If the breakpoint is
// supposed to be, but has not already been, disabled, then have the
// interpreter remove the breakpoint.
else if (!fEnable && m_state != BPS_DISABLED)
{
hr = m_pInterp->RemoveBreakpoint(m_sbstrDoc, this);
if (hr == S_OK)
{
// Change the state of the breakpoint to BPS_DISABLED.
m_state = BPS_DISABLED;
}
}
else
{
hr = S_FALSE;
}
}
else
{
hr = E_BP_DELETED;
}
return hr;
}