共用方式為


IDebugErrorBreakpointResolution2::GetBreakpointType

 

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

取得中斷點類型。

語法

HRESULT GetBreakpointType(   
   BP_TYPE* pBPType  
);  
int GetBreakpointType(   
   out enum_BP_TYPE pBPType  
);  

參數

pBPType
[out]傳回值,從BP_TYPE描述中斷點類型的列舉型別。

傳回值

如果成功,傳回S_OK; 否則傳回錯誤碼。

備註

這個方法會傳回所需的錯誤中斷點事件無法繫結時,中斷點的類型。

範例

下列範例示範如何實作這種簡單的方式CDebugErrorBreakpointResolution公開物件IDebugErrorBreakpointResolution2介面。

HRESULT CDebugErrorBreakpointResolution::GetBreakpointType(BP_TYPE* pBPType)    
{    
   HRESULT hr;    
  
   if (pBPType)    
   {    
      // Set default BP_TYPE.    
      *pBPType = BPT_NONE;    
  
      // Check if the BPERESI_BPRESLOCATION flag is set in BPERESI_FIELDS.    
      if (IsFlagSet(m_bpErrorResolutionInfo.dwFields, BPERESI_BPRESLOCATION))    
      {    
         // Set the new BP_TYPE.    
         *pBPType = m_bpErrorResolutionInfo.bpResLocation.bpType;    
         hr = S_OK;    
      }    
      else    
      {    
         hr = E_FAIL;    
      }    
   }    
   else    
   {    
      hr = E_INVALIDARG;    
   }    
  
   return hr;    
}    

另請參閱

IDebugErrorBreakpointResolution2
BP_TYPE