IDebugPendingBreakpoint2::EnumBoundBreakpoints
이 보류 중단점에서 바인딩된 중단점을 모두 열거 합니다.
HRESULT EnumBoundBreakpoints(
IEnumDebugBoundBreakpoints2** ppEnum
);
int EnumBoundBreakpoints(
out IEnumDebugBoundBreakpoints2 ppEnum
);
매개 변수
- ppEnum
[out] 반환 된 IEnumDebugBoundBreakpoints2 바인딩된 중단점을 열거 하는 개체입니다.
반환 값
성공 하면 반환 S_OK. 그렇지 않으면 오류 코드를 반환 합니다. 반환 E_BP_DELETED 중단점 삭제 된 경우입니다.
예제
다음 예제에서는 단순에이 메서드를 구현 하는 방법을 보여 줍니다. CPendingBreakpoint 를 노출 하는 개체는 IDebugPendingBreakpoint2 인터페이스입니다.
HRESULT CPendingBreakpoint::EnumBoundBreakpoints(IEnumDebugBoundBreakpoints2** ppEnum)
{
HRESULT hr;
// Verify that the passed IEnumDebugBoundBreakpoints2 interface pointer
// is valid.
if (ppEnum)
{
*ppEnum = NULL;
// Verify that the pending breakpoint has not been deleted. If
// deleted, then return hr = E_BP_DELETED.
if (m_state.state != PBPS_DELETED)
{
// If the bound breakpoint member variable is valid.
if (m_pBoundBP)
{
// Get the bound breakpoint.
CComPtr<IDebugBoundBreakpoint2> spBoundBP;
hr = m_pBoundBP->QueryInterface(&spBoundBP);
assert(hr == S_OK);
if (hr == S_OK)
{
// Create the bound breakpoint enumerator.
CComObject<CEnumDebugBoundBreakpoints>* pBoundEnum;
hr = CComObject<CEnumDebugBoundBreakpoints>::CreateInstance(&pBoundEnum);
assert(hr == S_OK);
if (hr == S_OK)
{
// Initialize the enumerator of bound breakpoints with
// the IDebugBoundBreakpoint2 information.
IDebugBoundBreakpoint2* rgBoundBP[] = { spBoundBP.p };
hr = pBoundEnum->Init(rgBoundBP, &(rgBoundBP[1]), NULL, AtlFlagCopy);
if (hr == S_OK)
{
// Verify that the passed IEnumDebugBoundBreakpoints2
// interface can be queried by the created
// CEnumDebugBoundBreakpoints object.
hr = pBoundEnum->QueryInterface(ppEnum);
assert(hr == S_OK);
}
// Otherwise, delete the CEnumDebugBoundBreakpoints object.
if (FAILED(hr))
{
delete pBoundEnum;
}
}
}
}
else
{
hr = S_FALSE;
}
}
else
{
hr = E_BP_DELETED;
}
}
else
{
hr = E_INVALIDARG;
}
return hr;
}