Events
Apr 8, 3 PM - May 28, 7 AM
Sharpen your AI skills and enter the sweepstakes to win a free Certification exam
Register now!This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Enumerates the various section contributions contained in the data source.
IDiaEnumSectionContribs : IUnknown
The following table shows the methods of IDiaEnumSectionContribs
.
Method | Description |
---|---|
IDiaEnumSectionContribs::get__NewEnum | Retrieves the IEnumVARIANT Interface version of this enumerator. |
IDiaEnumSectionContribs::get_Count | Retrieves the number of section contributions. |
IDiaEnumSectionContribs::Item | Retrieves section contributions by means of an index. |
IDiaEnumSectionContribs::Next | Retrieves a specified number of section contributions in the enumeration sequence. |
IDiaEnumSectionContribs::Skip | Skips a specified number of section contributions in an enumeration sequence. |
IDiaEnumSectionContribs::Reset | Resets an enumeration sequence to the beginning. |
IDiaEnumSectionContribs::Clone | Creates an enumerator that contains the same enumeration state as the current enumerator. |
Obtain this interface from the IDiaSession::getEnumTables method. See the example for details.
This example shows how to obtain (the GetEnumSectionContribs
function) and use (the ShowSectionContribs
function) the IDiaEnumSectionContribs
interface. For a more complete example of using section contributions, see the IDiaSectionContrib interface.
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();
}
}
Header: Dia2.h
Library: diaguids.lib
DLL: msdia80.dll
Events
Apr 8, 3 PM - May 28, 7 AM
Sharpen your AI skills and enter the sweepstakes to win a free Certification exam
Register now!