Remarque
L’accès à cette page nécessite une autorisation. Vous pouvez essayer de vous connecter ou de modifier des répertoires.
L’accès à cette page nécessite une autorisation. Vous pouvez essayer de modifier des répertoires.
Énumérez les différentes sources injectées contenues dans la source de données.
Syntax
IDiaEnumInjectedSources : IUnknown
Méthodes dans l'ordre Vtable
Le tableau suivant présente les méthodes de IDiaEnumInjectedSources.
| Méthode | Description |
|---|---|
| IDiaEnumInjectedSources::get__NewEnum | Récupère la version de l’interface IEnumVARIANT de cet énumérateur. |
| IDiaEnumInjectedSources::get_Count | Récupère le nombre de sources injectées. |
| IDiaEnumInjectedSources::Item | Récupère une source injectée au moyen d’un index. |
| IDiaEnumInjectedSources::Next | Récupère un nombre spécifié de sources injectées dans une séquence d’énumération. |
| IDiaEnumInjectedSources::Skip | Ignore un nombre spécifié de sources injectées dans une séquence d’énumération. |
| IDiaEnumInjectedSources::Reset | Réinitialise une séquence d'énumération. |
| IDiaEnumInjectedSources::Clone | Crée un énumérateur qui contient le même état d’énumération que l’actuel. |
Remarques
Remarques pour les appelants
Cette interface est obtenue en appelant la méthode IDiaSession ::findInjectSource avec le nom d’un fichier source spécifique ou en appelant la méthode IDiaSession ::getEnumTables avec l’identificateur global unique (GUID) de l’interface IDiaEnumInjectedSources .
Exemple
Cet exemple montre comment obtenir (la fonction GetEnumInjectedSources) et utiliser (la fonction DumpAllInjectedSources) l’interface IDiaEnumInjectedSources. Consultez l’interface IDiaPropertyStorage pour une implémentation de la fonction PrintPropertyStorage. Pour obtenir une autre sortie, consultez l’interface IDiaInjectSource.
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();
}
}
Configuration requise
En-tête : Dia2.h
Bibliothèque : diaguids.lib
DLL : msdia80.dll