IDiaEnumInjectedSources
Enumerare le varie origini inserite contenute nell'origine dati.
Sintassi
IDiaEnumInjectedSources : IUnknown
Metodi nell'ordine Vtable
Nella tabella seguente vengono illustrati i metodi di IDiaEnumInjectedSources
.
metodo | Descrizione |
---|---|
IDiaEnumInjectedSources::get__NewEnum | Recupera la versione dell'interfaccia IEnumVARIANT di questo enumeratore. |
IDiaEnumInjectedSources::get_Count | Recupera il numero di origini inserite. |
IDiaEnumInjectedSources::Item | Recupera un'origine inserita tramite un indice. |
IDiaEnumInjectedSources::Next | Recupera un numero specificato di origini inserite nella sequenza di enumerazione. |
IDiaEnumInjectedSources::Skip | Ignora un numero specificato di origini inserite in una sequenza di enumerazione. |
IDiaEnumInjectedSources::Reset | Reimposta una sequenza di enumerazione all'inizio. |
IDiaEnumInjectedSources::Clone | Crea un enumeratore che contiene lo stesso stato di enumerazione dell'enumeratore corrente. |
Osservazioni:
Note per i chiamanti
Questa interfaccia viene ottenuta chiamando il metodo IDiaSession::findInjectedSource con il nome di un file di origine specifico o chiamando il metodo IDiaSession::getEnumTables con l'identificatore univoco globale (GUID) dell'interfaccia IDiaEnumInjectedSources
.
Esempio
In questo esempio viene illustrato come ottenere (la GetEnumInjectedSources
funzione) e usare (la funzione) l'interfaccia DumpAllInjectedSources
IDiaEnumInjectedSources
. Vedere l'interfaccia IDiaProperty Archiviazione per un'implementazione della PrintPropertyStorage
funzione. Per un output alternativo, vedere l'interfaccia IDiaInjectedSource .
IDiaEnumInjectedSources* GetEnumInjectedSources(IDiaSession *pSession)
{
IDiaEnumInjectedSources* pUnknown = NULL;
REFIID iid = __uuidof(IDiaEnumInjectedSources);
IDiaEnumTables* pEnumTables = NULL;
IDiaTable* pTable = NULL;
ULONG celt = 0;
if (pSession->getEnumTables(&pEnumTables) != S_OK)
{
wprintf(L"ERROR - GetTable() getEnumTables\n");
return NULL;
}
while (pEnumTables->Next(1, &pTable, &celt) == S_OK && celt == 1)
{
// There is only one table that matches the given iid
HRESULT hr = pTable->QueryInterface(iid, (void**)&pUnknown);
pTable->Release();
if (hr == S_OK)
{
break;
}
}
pEnumTables->Release();
return pUnknown;
}
void DumpAllInjectedSources( IDiaSession* pSession)
{
IDiaEnumInjectedSources* pEnumInjSources;
pEnumInjSources = GetEnumInjectedSources(pSession);
if (pEnumInjSources != NULL)
{
IDiaInjectedSource* pInjSource;
ULONG celt = 0;
while(pEnumInjSources->Next(1, &pInjSource, &celt) == S_OK &&
celt == 1)
{
IDiaPropertyStorage *pPropertyStorage;
if (pInjSource->QueryInterface(__uuidof(IDiaPropertyStorage),
(void **)&pPropertyStorage) == S_OK)
{
PrintPropertyStorage(pPropertyStorage);
pPropertyStorage->Release();
}
pInjSource->Release();
}
pEnumInjSources->Release();
}
}
Requisiti
Intestazione: Dia2.h
Libreria: diaguids.lib
DLL: msdia80.dll