获取此解析表示断点的类型。
HRESULT GetBreakpointType(
BP_TYPE* pBPType
);
int GetBreakpointType(
out enum_ BP_TYPE pBPType
);
参数
- pBPType
[out] 返回从指定该断点的类型的 BP_TYPE 枚举的值。
返回值
如果成功,则返回; S_OK否则返回错误代码。 ,如果在关联的 BP_RESOLUTION_INFO 结构的 bpResLocation 字段无效,则返回 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;
}