IDiaEnumFrameData

Enumerates the various frame data elements contained in the data source.

Syntax

IDiaEnumFrameData : IUnknown

Methods in Vtable Order

The following table shows the methods of IDiaEnumFrameData.

Method Description
IDiaEnumFrameData::get__NewEnum Retrieves the IEnumVARIANT Interface version of this enumerator.
IDiaEnumFrameData::get_Count Retrieves the number of frame data elements.
IDiaEnumFrameData::Item Retrieves a frame data element by means of an index.
IDiaEnumFrameData::Next Retrieves a specified number of frame data elements in the enumeration sequence.
IDiaEnumFrameData::Skip Skips a specified number of frame data elements in an enumeration sequence.
IDiaEnumFrameData::Reset Resets an enumeration sequence to the beginning.
IDiaEnumFrameData::Clone Creates an enumerator that contains the same enumeration state as the current enumerator.
IDiaEnumFrameData::frameByRVA Returns a frame by relative virtual address (RVA).
IDiaEnumFrameData::frameByVA Returns a frame by virtual address (VA).

Remarks

Notes for Callers

Obtain this interface from the IDiaSession::getEnumTables method. See the example for details.

Example

This example shows how to obtain (the GetEnumFrameData function) and use (the ShowFrameData function) the IDiaEnumFrameData interface. See the IDiaFrameData interface for an example of the PrintFrameData function.


      IDiaEnumFrameData* GetEnumFrameData(IDiaSession *pSession)
{
    IDiaEnumFrameData* pUnknown    = NULL;
    REFIID             iid         = __uuidof(IDiaEnumFrameData);
    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 ShowFrameData(IDiaSession *pSession)
{
    IDiaEnumFrameData* pEnumFrameData = GetEnumFrameData(pSession);;

    if (pEnumFrameData != NULL)
    {
        IDiaFrameData* pFrameData;
        ULONG celt = 0;

        while(pEnumFrameData->Next(1, &pFrameData, &celt) == S_OK &&
              celt == 1)
        {
            PrintFrameData(pFrameData);
            pFrameData->Release();
        }
        pEnumFrameData->Release();
    }
}

Requirements

Header: Dia2.h

Library: diaguids.lib

DLL: msdia80.dll

See also