IDiaEnumLineNumbers

枚举数据源包含的各种行号。

IDiaEnumLineNumbers : IUnknown

方法按 Vtable 顺序

下表显示 IDiaEnumLineNumbers方法。

方法

说明

IDiaEnumLineNumbers::get__NewEnum

检索此枚举器的 IEnumVARIANT Interface 版本。

IDiaEnumLineNumbers::get_Count

检索行号的数目。

IDiaEnumLineNumbers::Item

通过索引检索行号。

IDiaEnumLineNumbers::Next

检索行号指定数目的枚举序列的。

IDiaEnumLineNumbers::Skip

跳过行号指定数目的枚举序列的。

IDiaEnumLineNumbers::Reset

重置枚举序列与开头。

IDiaEnumLineNumbers::Clone

创建包含枚举状态和枚举当前枚举数相同的枚举数。

备注

调用方的说明

此接口通过调用 IDiaSession 接口调用下列方法之一获取:

示例

此示例演示如何从会话的 IDiaEnumLineNumbers 接口。在这种情况下,该示例演示如何获取函数的行号枚举 (表示 pSymbol)。有关更完整的示例行号,请参见 IDiaLineNumber 接口。

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

要求

标题:Dia2.h

库:diaguids.lib

DLL:msdia80.dll

请参见

参考

IDiaSession

IDiaSession::findLinesByLinenum

IDiaSession::findLinesByRVA

IDiaSession::findLinesByVA

IDiaSession::findLines

IDiaSession::findLinesByAddr

其他资源

接口(调试接口访问 SDK)