Platform SDK: Synchronization Manager

ISyncMgrEnumItems

The ISyncMgrEnumItems interface is used to enumerate through an array of SYNCMGRITEM structures. Each of these structures provides information on an item that can be synchronized. ISyncMgrEnumItems has the same methods as all standard enumerator interfaces: Next, Skip, Reset, and Clone. For general information on these methods, refer to IEnumXXXX.

When to Implement

If the registered application works with the Synchronization Manager to synchronize items, it must implement an enumerator object with this interface to enumerate through the items.

When to Use

The SyncMgr obtains a pointer to this interface and calls each method during the synchronization process.

The prototypes of the methods are as follows:

HRESULT Next(
  ULONG celt,           // [in] Number of items in array
  LPSYNCMGRITEM rgelt,  // [out] Address of array containing items
  ULONG* pceltFetched   // [out] Address of variable containing actual number
                        //        of items
);
 
HRESULT Skip(
  ULONG celt                     // [in] Number of items to skip
);
 
HRESULT Reset(void);
 
HRESULT Clone(
  ISyncMgrEnumItems **ppenum     // [out] Address of variable that receives 
                                 //   the ISyncMgrEnumItems interface pointer
);

Remarks

ISyncMgrEnumItems::Next
Enumerates the next celt elements in the enumerator's list, returning them in rgelt along with the actual number of enumerated elements in pceltFetched.

E_NOTIMPL is not allowed as a return value. If an error value is returned, no entries in the rgelt array are valid on exit and require no release.

ISyncMgrEnumItems::Skip
Instructs the enumerator to skip the next celt elements in the enumeration so the next call to ISyncMgrEnumItems::Next does not return those elements.
ISyncMgrEnumItems::Reset
Instructs the enumerator to position itself at the beginning of the list of elements.

There is no guarantee that the same set of elements are enumerated on each pass through the list, nor are the elements necessarily be enumerated in the same order. The exact behavior depends on the collection being enumerated. It is too expensive in terms of memory for some collections, such as files in a directory, to maintain a specific state.

ISyncMgrEnumItems::Clone
Creates another items enumerator with the same state as the current enumerator to iterate over the same list. This method makes it possible to record a point in the enumeration sequence in order to return to that point at a later time.

The caller must release this new enumerator separately from the first enumerator.

Requirements

  Windows NT/2000: Requires Windows 2000 (or Windows NT 4.0 with Internet Explorer 5 or later).
  Windows 95/98: Requires Windows 95 or later (with Internet Explorer 5 or later).
  Header: Declared in Mobsync.h.

See Also

SYNCMGRITEM