description | title | ms.date | ms.topic | f1_keywords | helpviewer_keywords | author | ms.author | manager | ms.subservice | dev_langs | |||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Toggles the enabled state of the pending breakpoint. |
IDebugPendingBreakpoint2::Enable |
11/04/2016 |
reference |
|
|
maiak |
maiak |
mijacobs |
debug-diagnostics |
|
Toggles the enabled state of the pending breakpoint.
int Enable(
int fEnable
);
HRESULT Enable(
BOOL fEnable
);
fEnable
[in] Set to nonzero (TRUE
) to enable a pending breakpoint, or to zero (FALSE
) to disable.
If successful, returns S_OK
; otherwise, returns an error code. Returns E_BP_DELETED
if the breakpoint has been deleted.
When a pending breakpoint is enabled or disabled, all breakpoints bound from it are set to the same state.
This method may be called as many times as necessary, even if the breakpoint is already enabled or disabled.
The following example shows how to implement this method for a simple CPendingBreakpoint
object that exposes the IDebugPendingBreakpoint2 interface.
HRESULT CPendingBreakpoint::Enable(BOOL fEnable)
{
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 bound breakpoint member variable is valid, then enable or
// disable the bound breakpoint.
if (m_pBoundBP)
{
m_pBoundBP->Enable(fEnable);
}
// Set the PENDING_BP_STATE in the PENDING_BP_STATE_INFO structure
// to enabled or disabled depending on the passed BOOL condition.
m_state.state = fEnable ? PBPS_ENABLED : PBPS_DISABLED;
hr = S_OK;
}
else
{
hr = E_BP_DELETED;
}
return hr;
}