共用方式為


IDebugPendingBreakpoint2::Virtualize

切換虛擬化的狀態的暫止中斷點。 當暫止中斷點虛擬化時,偵錯引擎會嘗試將其繫結,每次新的程式碼載入程式。

HRESULT Virtualize( 
   BOOL fVirtualize
);
int Virtualize( 
   int fVirtualize
);

參數

  • fVirtualize
    [in]設定為非零值 (TRUE) 要虛擬化的暫止中斷點,或為零 (FALSE) 若要關閉虛擬化。

傳回值

如果成功的話,會傳回S_OK。 否則,會傳回錯誤碼。 傳回E_BP_DELETED如果已刪除中斷點。

備註

每次載入的程式碼,則會繫結虛擬化的中斷點。

範例

下列範例會示範如何實作這個方法,如CPendingBreakpoint物件,公開 (expose) IDebugPendingBreakpoint2介面。

HRESULT CPendingBreakpoint::Virtualize(BOOL fVirtualize)  
{  
   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 (fVirtualize)  
      {  
         // Set the PBPSF_VIRTUALIZED flag in the PENDING_BP_STATE_FLAGS 
         // structure.  
         SetFlag(m_state.flags, PBPSF_VIRTUALIZED);  
      }  
      else  
      {  
         // Clear the PBPSF_VIRTUALIZED flag in the PENDING_BP_STATE_FLAGS 
         // structure.  
         ClearFlag(m_state.flags, PBPSF_VIRTUALIZED);  
      }  
      hr = S_OK;  
   }  
   else  
   {  
      hr = E_BP_DELETED;  
   }  
  
   return hr;  
}  

請參閱

參考

IDebugPendingBreakpoint2