ISyncMgrSyncItemContainer::GetSyncItemEnumerator method (syncmgr.h)

Gets an interface that enumerates the handler's sync items.

Syntax

HRESULT GetSyncItemEnumerator(
  [out] IEnumSyncMgrSyncItems **ppenum
);

Parameters

[out] ppenum

Type: IEnumSyncMgrSyncItems**

When this method returns, contains the address of a pointer to an IEnumSyncMgrSyncItems instance. IEnumSyncMgrSyncItems can be used to retrieve an interface for each sync item in the set.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

This method replaces the older EnumSyncMgrItems method. The older method returned an enumerator interface which returned a SYNCMGRITEM structure for each sync item. To get the data previously provided by that structure, Sync Center calls QueryInterface on each item's ISyncMgrSyncItem interface to request a corresponding ISyncMgrSyncItemInfo interface.

The number of enumerated items can be obtained through the ISyncMgrSyncItemContainer::GetSyncItemCount method.

Examples

The following example shows an implementation of this method.

STDMETHODIMP CMyDeviceHandler::GetSyncItemEnumerator(
    __out IEnumSyncMgrSyncItems **ppenum)
{
    *ppenum = NULL;

    // Load the items using a private class method.
    HRESULT hr = _LoadItems();

    if (SUCCEEDED(hr))
    {
        hr = CEnumSyncMgrSyncItems_CreateInstance(this,
                                                  IID_PPV_ARGS(ppenum));
    }

    return hr;
}

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header syncmgr.h