|
2 | 2 | title: "IDiaEnumLineNumbers | Microsoft Docs"
|
3 | 3 | ms.date: "11/04/2016"
|
4 | 4 | ms.topic: "conceptual"
|
5 |
| -dev_langs: |
| 5 | +dev_langs: |
6 | 6 | - "C++"
|
7 |
| -helpviewer_keywords: |
| 7 | +helpviewer_keywords: |
8 | 8 | - "IDiaEnumLineNumbers interface"
|
9 | 9 | ms.assetid: cdf07b4f-19e4-4dcd-8af8-c2dbca586a7c
|
10 | 10 | author: "mikejo5000"
|
11 | 11 | ms.author: "mikejo"
|
12 | 12 | manager: jillfra
|
13 |
| -ms.workload: |
| 13 | +ms.workload: |
14 | 14 | - "multiple"
|
15 | 15 | ---
|
16 | 16 | # IDiaEnumLineNumbers
|
17 |
| -Enumerates the various line numbers contained in the data source. |
18 |
| - |
19 |
| -## Syntax |
20 |
| - |
21 |
| -``` |
22 |
| -IDiaEnumLineNumbers : IUnknown |
23 |
| -``` |
24 |
| - |
25 |
| -## Methods in Vtable Order |
26 |
| - The following table shows the methods of `IDiaEnumLineNumbers`. |
27 |
| - |
28 |
| -|Method|Description| |
29 |
| -|------------|-----------------| |
30 |
| -|[IDiaEnumLineNumbers::get__NewEnum](../../debugger/debug-interface-access/idiaenumlinenumbers-get-newenum.md)|Retrieves the [IEnumVARIANT Interface](/previous-versions/windows/desktop/api/oaidl/nn-oaidl-ienumvariant) version of this enumerator.| |
31 |
| -|[IDiaEnumLineNumbers::get_Count](../../debugger/debug-interface-access/idiaenumlinenumbers-get-count.md)|Retrieves the number of line numbers.| |
32 |
| -|[IDiaEnumLineNumbers::Item](../../debugger/debug-interface-access/idiaenumlinenumbers-item.md)|Retrieves a line number by means of an index.| |
33 |
| -|[IDiaEnumLineNumbers::Next](../../debugger/debug-interface-access/idiaenumlinenumbers-next.md)|Retrieves a specified number of line numbers in the enumeration sequence.| |
34 |
| -|[IDiaEnumLineNumbers::Skip](../../debugger/debug-interface-access/idiaenumlinenumbers-skip.md)|Skips a specified number of line numbers in an enumeration sequence.| |
35 |
| -|[IDiaEnumLineNumbers::Reset](../../debugger/debug-interface-access/idiaenumlinenumbers-reset.md)|Resets an enumeration sequence to the beginning.| |
36 |
| -|[IDiaEnumLineNumbers::Clone](../../debugger/debug-interface-access/idiaenumlinenumbers-clone.md)|Creates an enumerator that contains the same enumeration state as the current enumerator.| |
37 |
| - |
38 |
| -## Remarks |
39 |
| - |
40 |
| -## Notes for Callers |
41 |
| - This interface is obtained by calling one of the following methods in the [IDiaSession](../../debugger/debug-interface-access/idiasession.md) interface: |
42 |
| - |
43 |
| -- [IDiaSession::findLines](../../debugger/debug-interface-access/idiasession-findlines.md) |
44 |
| - |
45 |
| -- [IDiaSession::findLinesByAddr](../../debugger/debug-interface-access/idiasession-findlinesbyaddr.md) |
46 |
| - |
47 |
| -- [IDiaSession::findLinesByRVA](../../debugger/debug-interface-access/idiasession-findlinesbyrva.md) |
48 |
| - |
49 |
| -- [IDiaSession::findLinesByVA](../../debugger/debug-interface-access/idiasession-findlinesbyva.md) |
50 |
| - |
51 |
| -- [IDiaSession::findLinesByLinenum](../../debugger/debug-interface-access/idiasession-findlinesbylinenum.md) |
52 |
| - |
53 |
| -## Example |
54 |
| - 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](../../debugger/debug-interface-access/idialinenumber.md) interface. |
55 |
| - |
56 |
| -```C++ |
57 |
| -void dumpFunctionLines( IDiaSymbol* pSymbol, IDiaSession* pSession ) |
58 |
| -{ |
59 |
| - ULONGLONG length = 0; |
60 |
| - DWORD isect = 0; |
61 |
| - DWORD offset = 0; |
62 |
| - pSymbol->get_addressSection( &isect ); |
63 |
| - pSymbol->get_addressOffset( &offset ); |
64 |
| - pSymbol->get_length( &length ); |
65 |
| - if ( isect != 0 && length > 0 ) |
66 |
| - { |
67 |
| - CComPtr< IDiaEnumLineNumbers > pLines; |
68 |
| - if ( SUCCEEDED( pSession->findLinesByAddr( |
69 |
| - isect, |
70 |
| - offset, |
71 |
| - static_cast<DWORD>( length ), |
72 |
| - &pLines ) |
73 |
| - ) |
74 |
| - ) |
75 |
| - { |
76 |
| - // Do something with the enumeration |
77 |
| - } |
78 |
| - } |
79 |
| -} |
80 |
| -``` |
81 |
| - |
82 |
| -## Requirements |
83 |
| - Header: Dia2.h |
84 |
| - |
85 |
| - Library: diaguids.lib |
86 |
| - |
87 |
| - DLL: msdia80.dll |
88 |
| - |
89 |
| -## See Also |
90 |
| - [Interfaces (Debug Interface Access SDK)](../../debugger/debug-interface-access/interfaces-debug-interface-access-sdk.md) |
91 |
| - [IDiaSession](../../debugger/debug-interface-access/idiasession.md) |
92 |
| - [IDiaSession::findLinesByLinenum](../../debugger/debug-interface-access/idiasession-findlinesbylinenum.md) |
93 |
| - [IDiaSession::findLinesByRVA](../../debugger/debug-interface-access/idiasession-findlinesbyrva.md) |
94 |
| - [IDiaSession::findLinesByVA](../../debugger/debug-interface-access/idiasession-findlinesbyva.md) |
95 |
| - [IDiaSession::findLines](../../debugger/debug-interface-access/idiasession-findlines.md) |
96 |
| - [IDiaSession::findLinesByAddr](../../debugger/debug-interface-access/idiasession-findlinesbyaddr.md) |
| 17 | +Enumerates the various line numbers contained in the data source. |
| 18 | + |
| 19 | +## Syntax |
| 20 | + |
| 21 | +``` |
| 22 | +IDiaEnumLineNumbers : IUnknown |
| 23 | +``` |
| 24 | + |
| 25 | +## Methods in Vtable Order |
| 26 | +The following table shows the methods of `IDiaEnumLineNumbers`. |
| 27 | + |
| 28 | +|Method|Description| |
| 29 | +|------------|-----------------| |
| 30 | +|[IDiaEnumLineNumbers::get__NewEnum](../../debugger/debug-interface-access/idiaenumlinenumbers-get-newenum.md)|Retrieves the [IEnumVARIANT Interface](/previous-versions/windows/desktop/api/oaidl/nn-oaidl-ienumvariant) version of this enumerator.| |
| 31 | +|[IDiaEnumLineNumbers::get_Count](../../debugger/debug-interface-access/idiaenumlinenumbers-get-count.md)|Retrieves the number of line numbers.| |
| 32 | +|[IDiaEnumLineNumbers::Item](../../debugger/debug-interface-access/idiaenumlinenumbers-item.md)|Retrieves a line number by means of an index.| |
| 33 | +|[IDiaEnumLineNumbers::Next](../../debugger/debug-interface-access/idiaenumlinenumbers-next.md)|Retrieves a specified number of line numbers in the enumeration sequence.| |
| 34 | +|[IDiaEnumLineNumbers::Skip](../../debugger/debug-interface-access/idiaenumlinenumbers-skip.md)|Skips a specified number of line numbers in an enumeration sequence.| |
| 35 | +|[IDiaEnumLineNumbers::Reset](../../debugger/debug-interface-access/idiaenumlinenumbers-reset.md)|Resets an enumeration sequence to the beginning.| |
| 36 | +|[IDiaEnumLineNumbers::Clone](../../debugger/debug-interface-access/idiaenumlinenumbers-clone.md)|Creates an enumerator that contains the same enumeration state as the current enumerator.| |
| 37 | + |
| 38 | +## Remarks |
| 39 | + |
| 40 | +## Notes for Callers |
| 41 | +This interface is obtained by calling one of the following methods in the [IDiaSession](../../debugger/debug-interface-access/idiasession.md) interface: |
| 42 | + |
| 43 | +- [IDiaSession::findLines](../../debugger/debug-interface-access/idiasession-findlines.md) |
| 44 | + |
| 45 | +- [IDiaSession::findLinesByAddr](../../debugger/debug-interface-access/idiasession-findlinesbyaddr.md) |
| 46 | + |
| 47 | +- [IDiaSession::findLinesByRVA](../../debugger/debug-interface-access/idiasession-findlinesbyrva.md) |
| 48 | + |
| 49 | +- [IDiaSession::findLinesByVA](../../debugger/debug-interface-access/idiasession-findlinesbyva.md) |
| 50 | + |
| 51 | +- [IDiaSession::findLinesByLinenum](../../debugger/debug-interface-access/idiasession-findlinesbylinenum.md) |
| 52 | + |
| 53 | +## Example |
| 54 | +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](../../debugger/debug-interface-access/idialinenumber.md) interface. |
| 55 | + |
| 56 | +```C++ |
| 57 | +void dumpFunctionLines( IDiaSymbol* pSymbol, IDiaSession* pSession ) |
| 58 | +{ |
| 59 | + ULONGLONG length = 0; |
| 60 | + DWORD isect = 0; |
| 61 | + DWORD offset = 0; |
| 62 | + pSymbol->get_addressSection( &isect ); |
| 63 | + pSymbol->get_addressOffset( &offset ); |
| 64 | + pSymbol->get_length( &length ); |
| 65 | + if ( isect != 0 && length > 0 ) |
| 66 | + { |
| 67 | + CComPtr< IDiaEnumLineNumbers > pLines; |
| 68 | + if ( SUCCEEDED( pSession->findLinesByAddr( |
| 69 | + isect, |
| 70 | + offset, |
| 71 | + static_cast<DWORD>( length ), |
| 72 | + &pLines ) |
| 73 | + ) |
| 74 | + ) |
| 75 | + { |
| 76 | + // Do something with the enumeration |
| 77 | + } |
| 78 | + } |
| 79 | +} |
| 80 | +``` |
| 81 | +
|
| 82 | +## Requirements |
| 83 | +Header: Dia2.h |
| 84 | +
|
| 85 | +Library: diaguids.lib |
| 86 | +
|
| 87 | +DLL: msdia80.dll |
| 88 | +
|
| 89 | +## See Also |
| 90 | +[Interfaces (Debug Interface Access SDK)](../../debugger/debug-interface-access/interfaces-debug-interface-access-sdk.md) |
| 91 | +[IDiaSession](../../debugger/debug-interface-access/idiasession.md) |
| 92 | +[IDiaSession::findLinesByLinenum](../../debugger/debug-interface-access/idiasession-findlinesbylinenum.md) |
| 93 | +[IDiaSession::findLinesByRVA](../../debugger/debug-interface-access/idiasession-findlinesbyrva.md) |
| 94 | +[IDiaSession::findLinesByVA](../../debugger/debug-interface-access/idiasession-findlinesbyva.md) |
| 95 | +[IDiaSession::findLines](../../debugger/debug-interface-access/idiasession-findlines.md) |
| 96 | +[IDiaSession::findLinesByAddr](../../debugger/debug-interface-access/idiasession-findlinesbyaddr.md) |
0 commit comments