IDiaEnumDebugStreams::Item

Recupera un flusso di debug per l'utilizzo di un indice o di un nome.

HRESULT Item ( 
   VARIANT                   index,
   IDiaEnumDebugStreamData** stream
);

Parametri

  • indice
    [in] Indice o il nome del flusso di debug da recuperare.Se una variabile Integer viene utilizzata, deve essere compreso tra 0 e count-1, dove count viene restituito da IDiaEnumDebugStreams::get_Count metodo.

  • flusso
    [out] restituisce IDiaEnumDebugStreamData oggetto che rappresenta il flusso specificato di debug.

Valore restituito

Se l'operazione riesce, restituisce S_OK; in caso contrario, restituisce un codice di errore.

Esempio

IDiaEnumDebugStreamData *GetStreamData(IDiaEnumDebugStreams *pStreamList,
                                       LONG whichStream)
{
    IDiaEnumDebugStreamData *pStreamData = NULL;
    if (pStreamList != NULL)
    {
        LONG numStreams = 0;
        if (pStreamList->get_count(&numStreams) == S_OK &&
            whichStream >= 0 && whichStream < numStreams)
        {
            VARIANT vIndex;
            vIndex.vt   = VT_I4;
            vIndex.lVal = whichStream;
            if (pStreamList->Item(vIndex,&pStreamData) != S_OK)
            {
                 std::cerr << "Error retrieving stream " << whichStream << std::endl;
            }
        }
    }
    return(pStreamData);
}

Vedere anche

Riferimenti

IDiaEnumDebugStreamData

IDiaEnumDebugStreams