IDebugBreakpointResolution2::GetBreakpointType
取得這個解析所表示之斷點的類型。
語法
參數
pBPType
[out]從 指定這個斷點類型的BP_TYPE 列舉傳回值。
傳回值
如果成功,則會傳回 S_OK
;否則會傳回錯誤碼。 如果 bpResLocation
關聯 BP_RESOLUTION_INFO 結構中的字段無效,則傳回E_FAIL。
備註
例如,斷點可能是程式代碼或數據斷點。
範例
下列範例示範如何為公開IDebugBreakpointResolution2 介面的簡單CDebugBreakpointResolution
物件實作這個方法。
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;
}