다음을 통해 공유


IDebugPendingBreakpoint2::Enable

보류 중단점의 활성화 상태를 설정/해제 합니다.

HRESULT Enable( 
   BOOL fEnable
);
int Enable( 
   int fEnable
);

매개 변수

  • fEnable
    [in] 0이 아닌 값으로 설정 (TRUE) 보류 중인 중단점을 설정 하려면 또는 0으로 (FALSE) 사용 하지 않도록 설정 합니다.

반환 값

성공 하면 반환 S_OK. 그렇지 않으면 오류 코드를 반환 합니다. 반환 E_BP_DELETED 중단점 삭제 된 경우입니다.

설명

보류 중단점 설정 또는 해제 하면 모든 중단점을 바인딩할 상태로 동일 하 게 설정 됩니다.

중단점 이미 활성화 또는 비활성화 하는 경우에 여러 번 필요한 경우이 메서드를 호출할 수 있습니다.

예제

다음 예제에서는 단순에이 메서드를 구현 하는 방법을 보여 줍니다. CPendingBreakpoint 를 노출 하는 개체는 IDebugPendingBreakpoint2 인터페이스입니다.

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

참고 항목

참조

IDebugPendingBreakpoint2