Platform SDK: Synchronization Manager

ISyncMgrSynchronize::PrepareForSync

The ISyncMgrSynchronize::PrepareForSync method allows the registered application to display any user interface and perform any necessary initialization before the ISyncMgrSynchronize::Synchronize method is called. For example, an application such as the Microsoft® Outlook® e-mail client may need to display the password dialog box to enable the user to log onto the mail server.

HRESULT PrepareForSync(
  ULONG cbNumItems,           // Number of items in ItemId array
  SYNCMGRITEMID *pItemIDs,    // Array of ItemIds
  HWND hWndParent,            // Parent hWnd for user interface
  DWORD dwReserved            // Reserved
);

Parameters

cbNumItems
[in] Number of items in the ItemId array pointed to by pItemIDs.
pItemIDs
[in] Array of ItemIDs the user has chosen to synchronize.
hWndParent
[in] Handle to the parent hWnd that the registered application should use for any user interface element displayed. This value may be NULL.
dwReserved
[in] Reserved. Registered applications should ignore this value.

Return Values

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

S_OK
Preparation was successful.

Remarks

The registered application's handler should return from this method as soon as possible and then call the ISyncMgrSynchronizeCallback::PrepareForSyncCompleted method. It is possible for the registered application's handler to call the ISyncMgrSynchronizeCallback::PrepareForSyncCompleted method before returning from this method.

Registered applications should only show a user interface if the SYNCMGRFLAG_MAYBOTHERUSER flag was set in the dwSyncFlags parameter of the ISyncMgrSynchronize::Initialize method. If a registered application cannot prepare for synchronization without showing a user interface when the SYNCMGRFLAG_MAYBOTHERUSER flag is not set it should return S_FALSE from this method.

The array of ItemIDs that are passed into this method are relevant to the ISyncMgrSynchronize::Synchronize method also.

The ISyncMgrSynchronizeCallback methods can be called on any thread in the registered application.

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::Synchronize, ISyncMgrSynchronize::Initialize, ISyncMgrSynchronizeCallback::PrepareForSyncCompleted, ISyncMgrSynchronizeCallback, SYNCMGRFLAG