Platform SDK: Synchronization Manager

ISyncMgrSynchronize::Initialize

The Synchronization Manager calls the ISyncMgrSynchronize::Initialize method in the registered application's handler to determine whether the handler will process the synchronization event.

HRESULT Initialize(
  DWORD dwReserved,         // Reserved
  DWORD dwSyncMgrFlags,     // SYNCMGRFLAG enumeration
  DWORD cbCookie,           // Size of lpCookie
  BYTE const *lpCookie      // Token identifying application
);

Parameters

dwReserved
[in] Reserved; must be zero.
dwSyncMgrFlags
[in] Specifies the SYNCMGRFLAG enumeration values that describe how the synchronization event was initiated.
cbCookie
[in] Specifies the size in bytes of the lpCookie data.
lpCookie
[in] Points to the token identifying the application. This token was passed when the application programmatically invoked SyncMgr.

Return Values

This method supports the standard return values, E_INVALIDARG, E_UNEXPECTED, and E_OUTOFMEMORY, as well as the following:

S_OK
Initialization was successful.
S_FALSE
Application handler will not process the synchronize event.

Remarks

The SYNCMGRFLAG enumeration values apply through the lifetime of the ISyncMgrSynchronize interface and are used by the other ISyncMgrSynchronize methods.

If the application does not recognize the SYNCMGRFLAG event, the application should treat the event as a manual synchronization.

The registered application's handler cannot display a user interface within this call unless it is the very first time the initialize method is called. The application is allowed to display any one-time initialization it needs to set up items and introduce the user to the application's feature. If you need to display a user interface for any other reason as part of the synchronization process, you can do so in the ISyncMgrSynchronize::PrepareForSync method.

lpCookie is NULL unless the handling application invoked the Synchronization Manager programmatically using ISyncMgrSynchronizeInvoke::UpdateItems. In this case the CLSID is that of the handling application and the value of lpCookie is passed in by the handling application and is passed back by SyncMgr during synchronization for context. lpCookie is only meaningful if SYNCMGRFLAG_INVOKE is set

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

ISyncMgrSynchronize::PrepareForSync, ISyncMgrSynchronizeInvoke::UpdateItems, SYNCMGRFLAG