IDebugBreakpointResolution2::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
; 否則會傳回錯誤碼。 如果傳回 E_FAILbpResLocation
欄位相關聯BP_RESOLUTION_INFO結構不正確。
備註
中斷點可能是程式碼或資料中斷點,例如。
範例
下列範例示範如何實作這種簡單的方式CDebugBreakpointResolution
公開物件IDebugBreakpointResolution2介面。
HRESULT CDebugBreakpointResolution::GetBreakpointType(BP_TYPE* pBPType)
{
HRESULT hr;
if (pBPType)
{
// Set default BP_TYPE.
*pBPType = BPT_NONE;
// Check if the BPRESI_BPRESLOCATION flag is set in BPRESI_FIELDS.
if (IsFlagSet(m_bpResolutionInfo.dwFields, BPRESI_BPRESLOCATION))
{
// Set the new BP_TYPE.
*pBPType = m_bpResolutionInfo.bpResLocation.bpType;
hr = S_OK;
}
else
{
hr = E_FAIL;
}
}
else
{
hr = E_INVALIDARG;
}
return hr;
}
另請參閱
IDebugBreakpointResolution2
BP_TYPE
BPRESI_FIELDS
BP_RESOLUTION_LOCATION
BP_RESOLUTION_INFO