Delen via


IDiaEnumLineNumbers

Enumerates the various line numbers contained in the data source.

IDiaEnumLineNumbers : IUnknown

Methods in Vtable Order

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.

Remarks

Notes for Callers

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

Example

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
        }
    }
}

Requirements

Header: Dia2.h

Library: diaguids.lib

DLL: msdia80.dll

See Also

Reference

IDiaSession

IDiaSession::findLinesByLinenum

IDiaSession::findLinesByRVA

IDiaSession::findLinesByVA

IDiaSession::findLines

IDiaSession::findLinesByAddr

Other Resources

Interfaces (Debug Interface Access SDK)