IDiaEnumSectionContribs
枚举数据源中包含的各种节贡献。
语法
IDiaEnumSectionContribs : IUnknown
Vtable 顺序中的方法
下表显示了 IDiaEnumSectionContribs
方法。
方法 | 说明 |
---|---|
IDiaEnumSectionContribs::get__NewEnum | 检索该枚举器的 IEnumVARIANT Interface 版本。 |
IDiaEnumSectionContribs::get_Count | 检索节贡献的数量。 |
IDiaEnumSectionContribs::Item | 通过索引检索节贡献。 |
IDiaEnumSectionContribs::Next | 检索枚举序列中指定数量的节贡献。 |
IDiaEnumSectionContribs::Skip | 跳过枚举序列中指定数量的节贡献。 |
IDiaEnumSectionContribs::Reset | 将枚举序列重置到开头。 |
IDiaEnumSectionContribs::Clone | 创建一个枚举器,其中包含与当前枚举器相同的枚举状态。 |
备注
对调用者的说明
从 IDiaSession::getEnumTables 方法获取此接口。 参阅示例了解详细信息。
示例
此示例演示如何获取(GetEnumSectionContribs
函数)和使用(ShowSectionContribs
函数)IDiaEnumSectionContribs
接口。 有关使用节贡献的更完整示例,请参阅 IDiaSectionContrib 接口。
IDiaEnumSectionContribs* GetEnumSectionContribs(IDiaSession *pSession)
{
IDiaEnumSectionContribs* pUnknown = NULL;
REFIID iid = __uuidof(IDiaEnumSectionContribs);
IDiaEnumTables* pEnumTables = NULL;
IDiaTable* pTable = NULL;
ULONG celt = 0;
if (pSession->getEnumTables(&pEnumTables) != S_OK)
{
wprintf(L"ERROR - GetTable() getEnumTables\n");
return NULL;
}
while (pEnumTables->Next(1, &pTable, &celt) == S_OK && celt == 1)
{
// There is only one table that matches the given iid
HRESULT hr = pTable->QueryInterface(iid, (void**)&pUnknown);
pTable->Release();
if (hr == S_OK)
{
break;
}
}
pEnumTables->Release();
return pUnknown;
}
void ShowSectionContribs(IDiaSession *pSession)
{
IDiaEnumSectionContribs* pEnumSectionContribs;
pEnumSectionContribs = GetEnumSectionContribs(pSession);
if (pSectionContrib != NULL)
{
IDiaSectionContrib* pSectionContrib;
ULONG celt = 0;
while(pEnumSectionContribs->Next(1, &pSectionContrib, &celt) == S_OK &&
celt == 1)
{
PrintSectionContrib(pSectionContrib, pSession);
pSectionContrib->Release();
}
pSectionContrib->Release();
}
}
要求
标头:Dia2.h
库:diaguids.lib
DLL:msdia80.dll