IDebugPendingBreakpoint2::EnumErrorBreakpoints
보류 중인 이 중단점에서 발생한 모든 오류 중단점 목록을 가져옵니다.
구문
int EnumErrorBreakpoints(
enum_BP_ERROR_TYPE bpErrorType,
out IEnumDebugErrorBreakpoints2 ppEnum
);
매개 변수
bpErrorType
[in] 열거할 오류 형식을 선택하는 BP_ERROR_TYPE 열거형의 값 조합입니다.
ppEnum
[out] IDebugErrorBreakpoint2 개체 목록을 포함하는 IEnumDebugErrorBreakpoints2 개체를 반환합니다.
Return Value
성공하면 S_OK
를 반환하고, 실패하면 오류 코드를 반환합니다. 중단점이 삭제된 경우 E_BP_DELETED
를 반환합니다.
예시
다음 예제에서는 CPendingBreakpoint
IDebugPendingBreakpoint2 인터페이스를 노출하는 간단한 개체에 대해 이 메서드를 구현하는 방법을 보여 줍니다.
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;
}