Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
IDiaEnumLineNumbers

IDiaEnumLineNumbers

Enumerates the various line numbers contained in the data source.

IDiaEnumLineNumbers : IUnknown

The following table shows the methods of IDiaEnumLineNumbers.

Method

Description

IDiaEnumLineNumbers::get__NewEnum

Retrieves the IEnumVARIANT Interface version of this enumerator.

IDiaEnumLineNumbers::get_Count

Retrieves the number of line numbers.

IDiaEnumLineNumbers::Item

Retrieves a line number by means of an index.

IDiaEnumLineNumbers::Next

Retrieves a specified number of line numbers in the enumeration sequence.

IDiaEnumLineNumbers::Skip

Skips a specified number of line numbers in an enumeration sequence.

IDiaEnumLineNumbers::Reset

Resets an enumeration sequence to the beginning.

IDiaEnumLineNumbers::Clone

Creates an enumerator that contains the same enumeration state as the current enumerator.

Notes for Callers

This example shows how to obtain the IDiaEnumLineNumbers interface from a session. In this case, the example shows how to get the line number enumeration for a function (represented by pSymbol). For a more complete example of using line numbers, see the IDiaLineNumber interface.

void dumpFunctionLines( IDiaSymbol* pSymbol, IDiaSession* pSession )
{
    ULONGLONG length = 0;
    DWORD isect = 0;
    DWORD offset = 0;
    pSymbol->get_addressSection( &isect );
    pSymbol->get_addressOffset( &offset );
    pSymbol->get_length( &length );
    if ( isect != 0 && length > 0 )
    {
        CComPtr< IDiaEnumLineNumbers > pLines;
        if ( SUCCEEDED( pSession->findLinesByAddr(
                                      isect,
                                      offset,
                                      static_cast<DWORD>( length ),
                                      &pLines )
                      )
           )
        {
            // Do something with the enumeration
        }
    }
}

Header: Dia2.h

Library: diaguids.lib

DLL: msdia80.dll

Show:
© 2015 Microsoft