Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

Enumeration is the process of accessing every object in a directory or folder to determine whether the object has changed and whether changed objects meet the selection criteria.

  1. The service manager calls IReplStore::IsFolderChanged.

  2. If IReplStore::IsFolderChangedreturns TRUE, the service manager calls IReplStore::FindFirstItem.

  3. If additional objects exist, IReplStore::FindFirstItemsets *pfExistto TRUE.

  4. The service manager calls IReplStore::FindNextItemrepeatedly until *pfExistis FALSE, which indicates there are no more objects to be enumerated.

  5. The service manager calls IReplStore::FindItemCloseto free any resources that were used during enumeration.

The following code example shows how to implement IReplStore::FindFirstItem.

Copy Code
STDMETHODIMP CStore::FindFirstItem
(
   HREPLFLD hFolder,   // Handle to a folder
   HREPLITEM *phItem,   // Output pointer to the handle of the
first
				 // item in the folder
   BOOL *pfExist	// Output pointer to a Boolean value that is
set
				 // to TRUE if there is an object in the folder
)
{
   CFolder *pFolder = (CFolder*)hFolder;

   // Find the first item.
   // pItem in the following code points to the first item.
   // ...
   // Implementation retrieves the unique identifier from the first
item.
   // pItem->m_uid		= retrieved_unique_ID;

   // Implementation retrieves whatever it uses to verify the first
item
   // has changed; for example, a time stamp.
   // pItem->m_ftModified = retrieved_time_stamp;

   *phItem = (HREPLITEM)pItem;

   if (pfExist)
	*pfExist = TRUE;

   return NOERROR;
}

During enumeration, you can select just those objects you want to synchronize by having the desktop provider return to the service manager only those that meet your criteria. For example, you might want to synchronize only appointments that fall within the next three days. The service manager accesses the selection criteria — which are stored with the folder handle — by calling IReplStore::IsItemReplicated.

Important:
Any object not returned by the enumeration appears as a deleted desktop object. The service manager assumes the object has been deleted and deletes the corresponding device object. To avoid deleting objects that do not meet the selection criteria, be sure the desktop provider's enumeration returns every object in the store whether or not the object meets the selection criteria.

You can reselect as conditions change. For example, you might want to synchronize appointments falling within the next three days, every day. In order to determine the date range to select for, the service manager calls IReplStore::ReportStatuswith RSC_DATE_CHANGED to initiate the synchronization process.

See Also

500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@systemmanager.forsenergy.ru to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.