Platform SDK: Transaction Server

ISharedPropertyGroupManager::get__NewEnum Method Example

[This product will work only on Windows NT 4.0 versions and earlier. For Windows 2000 and later, see COM+ (Component Services).]

#include <mtxspm.h>

ISharedPropertyGroupManager* pspgm = NULL;
IUnknown* pUnknown = NULL;
IEnumVARIANT* pEnum = NULL;
VARIANT v;
ULONG cElementsFetched;
int i;
HRESULT hr;

// Get the enumerator object.
hr = pspgm->get__NewEnum(&pUnknown);

// Query for the IEnumVARIANT interface.
hr = pUnknown->QueryInterface(IID_IEnumVARIANT, (void**) &pEnum);

// Use the enumerator to iterate through
// the property group names.
for(i = 0; i < 10; i++)
{
    VariantInit(&v);
    pEnum->Next(1, &v, &cElementsFetched);
    // Do something with the returned
    // property group names.
}