Catatan
Akses ke halaman ini memerlukan otorisasi. Anda dapat mencoba masuk atau mengubah direktori.
Akses ke halaman ini memerlukan otorisasi. Anda dapat mencoba mengubah direktori.
Menghitung berbagai sumber yang dimasukkan yang terkandung dalam sumber data.
Sintaks
IDiaEnumInjectedSources : IUnknown
Metode dalam Urutan Vtable
Tabel berikut memperlihatkan metode IDiaEnumInjectedSources.
| Metode | Deskripsi |
|---|---|
| IDiaEnumInjectedSources::get__NewEnum | Mengambil versi Antarmuka IEnumVARIANT dari enumerator ini. |
| IDiaEnumInjectedSources::get_Count | Mengambil jumlah sumber yang dimasukkan. |
| IDiaEnumInjectedSources::Item | Mengambil sumber yang dimasukkan melalui indeks. |
| IDiaEnumInjectedSources::Next | Mengambil sejumlah sumber yang diinjeksikan dalam urutan enumerasi. |
| IDiaEnumInjectedSources::Skip | Melompati sejumlah sumber yang dimasukkan dalam urutan enumerasi. |
| IDiaEnumInjectedSources::Reset | Mereset urutan enumerasi ke awal. |
| IDiaEnumInjectedSources::Clone | Membuat enumerator yang berisi status enumerasi yang sama dengan enumerator saat ini. |
Keterangan
Catatan untuk Penelepon
Antarmuka ini diperoleh dengan memanggil metode IDiaSession::findInjectedSource dengan nama file sumber tertentu atau dengan memanggil metode IDiaSession::getEnumTables dengan pengidentifikasi unik global (GUID) IDiaEnumInjectedSources antarmuka.
Contoh
Contoh ini menunjukkan cara mendapatkan ( GetEnumInjectedSources fungsi) dan menggunakan ( DumpAllInjectedSources fungsi) IDiaEnumInjectedSources antarmuka. Lihat antarmuka IDiaPropertyStorage untuk implementasi PrintPropertyStorage fungsi. Untuk output alternatif, lihat antarmuka 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();
}
}
Persyaratan
Header: Dia2.h
Library: diaguids.lib
DLL: msdia80.dll