The new home for Visual Studio documentation is Visual Studio 2017 Documentation on

The latest version of this topic can be found at IDiaEnumLineNumbers.

Enumerates the various line numbers contained in the data source.

IDiaEnumLineNumbers : IUnknown  

The following table shows the methods of IDiaEnumLineNumbers.

IDiaEnumLineNumbers::get__NewEnumRetrieves the IEnumVARIANT Interface version of this enumerator.
IDiaEnumLineNumbers::get_CountRetrieves the number of line numbers.
IDiaEnumLineNumbers::ItemRetrieves a line number by means of an index.
IDiaEnumLineNumbers::NextRetrieves a specified number of line numbers in the enumeration sequence.
IDiaEnumLineNumbers::SkipSkips a specified number of line numbers in an enumeration sequence.
IDiaEnumLineNumbers::ResetResets an enumeration sequence to the beginning.
IDiaEnumLineNumbers::CloneCreates an enumerator that contains the same enumeration state as the current enumerator.

This interface is obtained by calling one of the following methods in the IDiaSession interface:

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(  
                                      static_cast<DWORD>( length ),  
                                      &pLines )  
            // Do something with the enumeration  

Header: Dia2.h

Library: diaguids.lib

DLL: msdia80.dll

Interfaces (Debug Interface Access SDK)