共用方式為


IDebugPendingBreakpoint2::Delete

 

如需 Visual Studio 2017 的最新文件請參閱 Visual Studio 2017 文件

刪除此暫止中斷點和從它繫結的所有中斷點。

語法

HRESULT Delete(   
   void   
);  
int Delete();  

傳回值

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

範例

下列範例示範如何實作這種簡單的方式CPendingBreakpoint實作物件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;    
}    

另請參閱

IDebugPendingBreakpoint2