다음을 통해 공유


IDiaEnumDebugStreams::Item

인덱스 또는 이름을 통해 디버그 스트림을 검색합니다.

구문

HRESULT Item (
    VARIANT                   index,
    IDiaEnumDebugStreamData** stream
);

매개 변수

색인

[in] 검색할 디버그 스트림의 인덱스 또는 이름입니다. 정수 변형이 사용되는 경우 범위는 0~count-1입니다. 여기서 countIDiaEnumDebugStreams::get_Count 메서드에서 반환됩니다.

stream

[out] 지정된 디버그 스트림을 나타내는 IDiaEnumDebugStreamData 개체를 반환합니다.

Return Value

성공하면 S_OK를 반환하고, 실패하면 오류 코드를 반환합니다.

예시

IDiaEnumDebugStreamData *GetStreamData(IDiaEnumDebugStreams *pStreamList,
                                       LONG whichStream)
{
    IDiaEnumDebugStreamData *pStreamData = NULL;
    if (pStreamList != NULL)
    {
        LONG numStreams = 0;
        if (pStreamList->get_count(&numStreams) == S_OK &&
            whichStream >= 0 && whichStream < numStreams)
        {
            VARIANT vIndex;
            vIndex.vt   = VT_I4;
            vIndex.lVal = whichStream;
            if (pStreamList->Item(vIndex,&pStreamData) != S_OK)
            {
                std::cerr << "Error retrieving stream " << whichStream << std::endl;
            }
        }
    }
    return(pStreamData);
}

참고 항목