IDebugPendingBreakpoint2::EnumBoundBreakpointsIDebugPendingBreakpoint2::EnumBoundBreakpoints

Enumera todos los puntos de interrupción enlazados desde este punto de interrupción pendiente.Enumerates all breakpoints bound from this pending breakpoint.

SintaxisSyntax

HRESULT EnumBoundBreakpoints(   
   IEnumDebugBoundBreakpoints2** ppEnum  
);  
int EnumBoundBreakpoints(   
   out IEnumDebugBoundBreakpoints2 ppEnum  
);  

ParámetrosParameters

ppEnum
[out] Devuelve un IEnumDebugBoundBreakpoints2 objeto que enumera los puntos de interrupción enlazados.[out] Returns an IEnumDebugBoundBreakpoints2 object that enumerates the bound breakpoints.

Valor devueltoReturn Value

Si se realiza correctamente, devuelve S_OK; en caso contrario, devuelve un código de error.If successful, returns S_OK; otherwise, returns an error code. Devuelve E_BP_DELETED si se ha eliminado el punto de interrupción.Returns E_BP_DELETED if the breakpoint has been deleted.

EjemploExample

En el ejemplo siguiente se muestra cómo implementar este método para un sencillo CPendingBreakpoint objeto que expone la IDebugPendingBreakpoint2 interfaz.The following example shows how to implement this method for a simple CPendingBreakpoint object that exposes the IDebugPendingBreakpoint2 interface.

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;    
}    

Vea tambiénSee Also

IDebugPendingBreakpoint2 IDebugPendingBreakpoint2
IEnumDebugBoundBreakpoints2IEnumDebugBoundBreakpoints2