|
2 | 2 | title: "IDiaEnumDebugStreams::Item | 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 | - "IDiaEnumDebugStreams::Item method"
|
9 | 9 | ms.assetid: 6b388fe1-eabc-4720-9d59-dc09b0ceaeac
|
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 | # IDiaEnumDebugStreams::Item
|
17 |
| -Retrieves a debug stream by means of an index or name. |
18 |
| - |
19 |
| -## Syntax |
20 |
| - |
21 |
| -```C++ |
22 |
| -HRESULT Item ( |
23 |
| - VARIANT index, |
24 |
| - IDiaEnumDebugStreamData** stream |
25 |
| -); |
26 |
| -``` |
27 |
| - |
28 |
| -#### Parameters |
29 |
| - index |
30 |
| - [in] Index or name of the debug stream to be retrieved. If an integer variant is used, it must be in the range 0 to `count`-1, where `count` is as returned by the [IDiaEnumDebugStreams::get_Count](../../debugger/debug-interface-access/idiaenumdebugstreams-get-count.md) method. |
31 |
| - |
32 |
| - stream |
33 |
| - [out] Returns an [IDiaEnumDebugStreamData](../../debugger/debug-interface-access/idiaenumdebugstreamdata.md) object representing the specified debug stream. |
34 |
| - |
35 |
| -## Return Value |
36 |
| - If successful, returns `S_OK`; otherwise, returns an error code. |
37 |
| - |
38 |
| -## Example |
39 |
| - |
40 |
| -```C++ |
41 |
| -IDiaEnumDebugStreamData *GetStreamData(IDiaEnumDebugStreams *pStreamList, |
42 |
| - LONG whichStream) |
43 |
| -{ |
44 |
| - IDiaEnumDebugStreamData *pStreamData = NULL; |
45 |
| - if (pStreamList != NULL) |
46 |
| - { |
47 |
| - LONG numStreams = 0; |
48 |
| - if (pStreamList->get_count(&numStreams) == S_OK && |
49 |
| - whichStream >= 0 && whichStream < numStreams) |
50 |
| - { |
51 |
| - VARIANT vIndex; |
52 |
| - vIndex.vt = VT_I4; |
53 |
| - vIndex.lVal = whichStream; |
54 |
| - if (pStreamList->Item(vIndex,&pStreamData) != S_OK) |
55 |
| - { |
56 |
| - std::cerr << "Error retrieving stream " << whichStream << std::endl; |
57 |
| - } |
58 |
| - } |
59 |
| - } |
60 |
| - return(pStreamData); |
61 |
| -} |
62 |
| -``` |
63 |
| - |
64 |
| -## See Also |
65 |
| - [IDiaEnumDebugStreamData](../../debugger/debug-interface-access/idiaenumdebugstreamdata.md) |
66 |
| - [IDiaEnumDebugStreams](../../debugger/debug-interface-access/idiaenumdebugstreams.md) |
| 17 | +Retrieves a debug stream by means of an index or name. |
| 18 | + |
| 19 | +## Syntax |
| 20 | + |
| 21 | +```C++ |
| 22 | +HRESULT Item ( |
| 23 | + VARIANT index, |
| 24 | + IDiaEnumDebugStreamData** stream |
| 25 | +); |
| 26 | +``` |
| 27 | + |
| 28 | +#### Parameters |
| 29 | +index |
| 30 | +[in] Index or name of the debug stream to be retrieved. If an integer variant is used, it must be in the range 0 to `count`-1, where `count` is as returned by the [IDiaEnumDebugStreams::get_Count](../../debugger/debug-interface-access/idiaenumdebugstreams-get-count.md) method. |
| 31 | + |
| 32 | +stream |
| 33 | +[out] Returns an [IDiaEnumDebugStreamData](../../debugger/debug-interface-access/idiaenumdebugstreamdata.md) object representing the specified debug stream. |
| 34 | + |
| 35 | +## Return Value |
| 36 | +If successful, returns `S_OK`; otherwise, returns an error code. |
| 37 | + |
| 38 | +## Example |
| 39 | + |
| 40 | +```C++ |
| 41 | +IDiaEnumDebugStreamData *GetStreamData(IDiaEnumDebugStreams *pStreamList, |
| 42 | + LONG whichStream) |
| 43 | +{ |
| 44 | + IDiaEnumDebugStreamData *pStreamData = NULL; |
| 45 | + if (pStreamList != NULL) |
| 46 | + { |
| 47 | + LONG numStreams = 0; |
| 48 | + if (pStreamList->get_count(&numStreams) == S_OK && |
| 49 | + whichStream >= 0 && whichStream < numStreams) |
| 50 | + { |
| 51 | + VARIANT vIndex; |
| 52 | + vIndex.vt = VT_I4; |
| 53 | + vIndex.lVal = whichStream; |
| 54 | + if (pStreamList->Item(vIndex,&pStreamData) != S_OK) |
| 55 | + { |
| 56 | + std::cerr << "Error retrieving stream " << whichStream << std::endl; |
| 57 | + } |
| 58 | + } |
| 59 | + } |
| 60 | + return(pStreamData); |
| 61 | +} |
| 62 | +``` |
| 63 | +
|
| 64 | +## See Also |
| 65 | +[IDiaEnumDebugStreamData](../../debugger/debug-interface-access/idiaenumdebugstreamdata.md) |
| 66 | +[IDiaEnumDebugStreams](../../debugger/debug-interface-access/idiaenumdebugstreams.md) |
0 commit comments