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 |
---|---|
Retrieves the IEnumVARIANT Interface version of this enumerator. |
|
Retrieves the number of line numbers. |
|
Retrieves a line number by means of an index. |
|
Retrieves a specified number of line numbers in the enumeration sequence. |
|
Skips a specified number of line numbers in an enumeration sequence. |
|
Resets an enumeration sequence to the beginning. |
|
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::findLinesByLinenum