この保留中のブレークポイントが原因で発生したすべてのエラー ブレークポイントの一覧を取得します。
構文
int EnumErrorBreakpoints(
enum_BP_ERROR_TYPE bpErrorType,
out IEnumDebugErrorBreakpoints2 ppEnum
);
パラメーター
bpErrorType
[in] 列挙するエラーの種類を選択する BP_ERROR_TYPE 列挙体の値の組み合わせ。
ppEnum
[out] IDebugErrorBreakpoint2 オブジェクトの一覧を含む IEnumDebugErrorBreakpoints2 オブジェクトを返します。
戻り値
成功した場合は、S_OK
を返します。それ以外の場合は、エラー コードを返します。 ブレークポイントが削除されている場合は、E_BP_DELETED
を返します。
例
次の例は、IDebugPendingBreakpoint2 インターフェイスを公開するシンプルな CPendingBreakpoint
オブジェクトに対してこのメソッドを実装する方法を示しています。
HRESULT CPendingBreakpoint::EnumErrorBreakpoints(
BP_ERROR_TYPE bpErrorType,
IEnumDebugErrorBreakpoints2** ppEnum)
{
HRESULT hr;
// Verify that the passed IEnumDebugErrorBreakpoints2 interface pointer
// is valid.
if (ppEnum)
{
// Verify that the pending breakpoint has not been deleted. If
// deleted, then return hr = E_BP_DELETED.
if (m_state.state != PBPS_DELETED)
{
// Verify that this error is not a warning.
// All errors supported by this DE are errors, not warnings.
if (IsFlagSet(bpErrorType, BPET_TYPE_ERROR) && m_pErrorBP)
{
// Get the error breakpoint.
CComPtr<IDebugErrorBreakpoint2> spErrorBP;
hr = m_pErrorBP->QueryInterface(&spErrorBP);
assert(hr == S_OK);
if (hr == S_OK)
{
// Create the error breakpoint enumerator.
CComObject<CEnumDebugErrorBreakpoints>* pErrorEnum;
hr = CComObject<CEnumDebugErrorBreakpoints>::CreateInstance(&pErrorEnum);
assert(hr == S_OK);
if (hr == S_OK)
{
// Initialize the enumerator of error breakpoints with
// the IDebugErrorBreakpoint2 information.
IDebugErrorBreakpoint2* rgpErrorBP[] = { spErrorBP.p };
hr = pErrorEnum->Init(rgpErrorBP, &(rgpErrorBP[1]), NULL, AtlFlagCopy);
if (hr == S_OK)
{
// Verify that the passed IEnumDebugErrorBreakpoints2
// interface can be queried by the created
// CEnumDebugErrorBreakpoints object.
hr = pErrorEnum->QueryInterface(ppEnum);
assert(hr == S_OK);
}
// Otherwise, delete the CEnumDebugErrorBreakpoints
// object.
if (FAILED(hr))
{
delete pErrorEnum;
}
}
}
}
else
{
hr = S_FALSE;
}
}
else
{
hr = E_BP_DELETED;
}
}
else
{
hr = E_INVALIDARG;
}
return hr;
}