IDiaEnumInjectedSources

Wyliczanie różnych wstrzykniętych źródeł zawartych w źródle danych.

Składnia

IDiaEnumInjectedSources : IUnknown

Metody w tabeli Vtable Order

W poniższej tabeli przedstawiono metody .IDiaEnumInjectedSources

Metoda opis
IDiaEnumInjectedSources::get__NewEnum Pobiera wersję interfejsu IEnumVARIANT tego modułu wyliczającego.
IDiaEnumInjectedSources::get_Count Pobiera liczbę wstrzykniętych źródeł.
IDiaEnumInjectedSources::Item Pobiera wstrzyknięte źródło za pomocą indeksu.
IDiaEnumInjectedSources::Next Pobiera określoną liczbę wstrzykniętych źródeł w sekwencji wyliczenia.
IDiaEnumInjectedSources::Skip Pomija określoną liczbę wstrzykniętych źródeł w sekwencji wyliczenia.
IDiaEnumInjectedSources::Reset Resetuje sekwencję wyliczenia na początku.
IDiaEnumInjectedSources::Clone Tworzy moduł wyliczający, który zawiera ten sam stan wyliczenia co bieżący moduł wyliczający.

Uwagi

Uwagi dotyczące wywoływania

Ten interfejs jest uzyskiwany przez wywołanie metody IDiaSession::findInjectedSource o nazwie określonego pliku źródłowego lub wywołanie metody IDiaSession::getEnumTables za pomocą identyfikatora GUID interfejsu IDiaEnumInjectedSources .

Przykład

W tym przykładzie pokazano, jak uzyskać ( GetEnumInjectedSources funkcję) i użyć ( DumpAllInjectedSources funkcji) interfejsu IDiaEnumInjectedSources . Zobacz interfejs IDiaPropertyStorage, aby zapoznać się z implementacją PrintPropertyStorage funkcji. Aby uzyskać alternatywne dane wyjściowe, zobacz interfejs 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();
    }
}

Wymagania

Nagłówek: Dia2.h

Biblioteka: diaguids.lib

BIBLIOTEKA DLL: msdia80.dll

Zobacz też