다음을 통해 공유


IDiaEnumInjectedSources

데이터 소스에 포함된 다양한 삽입된 소스를 열거합니다.

구문

IDiaEnumInjectedSources : IUnknown

Vtable 순서의 메서드

다음 표에서는 IDiaEnumInjectedSources 메서드를 보여 줍니다.

메서드 설명
IDiaEnumInjectedSources::get__NewEnum 이 열거자의 IEnumVARIANT Interface 버전을 검색합니다.
IDiaEnumInjectedSources::get_Count 삽입된 소스 수를 검색합니다.
IDiaEnumInjectedSources::Item 인덱스를 통해 삽입된 소스를 검색합니다.
IDiaEnumInjectedSources::Next 열거형 시퀀스에서 지정된 수의 삽입된 소스를 검색합니다.
IDiaEnumInjectedSources::Skip 열거형 시퀀스에서 지정된 수의 삽입된 소스를 건너뜁니다.
IDiaEnumInjectedSources::Reset 열거형 시퀀스를 초기화합니다.
IDiaEnumInjectedSources::Clone 현재 열거자와 동일한 열거 상태를 포함하는 열거자를 만듭니다.

설명

호출자 참고 사항

이 인터페이스는 특정 소스 파일의 이름으로 IDiaSession::findInjectedSource 메서드를 호출하거나 인터페이스의 GUID(Globally Unique Identifier)IDiaEnumInjectedSources를 사용하여 IDiaSession::getEnumTables 메서드를 호출하여 가져옵니다.

예시

이 예제에서는 (GetEnumInjectedSources 함수)를 가져오고 (DumpAllInjectedSources 함수) IDiaEnumInjectedSources 인터페이스를 사용하는 방법을 보여 줍니다. PrintPropertyStorage 함수 구현은 IDiaPropertyStorage 인터페이스를 참조하세요. 대체 출력은 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();
    }
}

요구 사항

헤더: Dia2.h

라이브러리: diaguids.lib

DLL: msdia80.dll

참고 항목