Share via


Initializing the Store

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

When a connection is made, the service manager calls IReplStore::Initialize to let the service provider initialize the store. The service manager does the following.

  • Initializes the data store and compares store identifiers to determine if the desktop store has changed since the previous initialization.
  • Enumerates each desktop object in the desktop store.
  • Determines which data has changed and transfers that data from the desktop to the Windows Mobile device, or from the device to the desktop.

To do these things, the service manager calls the desktop provider to respond with the necessary information. The following illustration shows the sequence in which the service manager calls the desktop provider.

Aa914307.068af3b0-499d-4613-88ba-2088019d7c48(en-us,MSDN.10).gif

To access the profile information for a device

  1. Call CeGetDeviceId to retrieve the registry key for a connected Windows Mobile device profile.

  2. Call IReplNotify::QueryDevice with QDC_SEL_DEVICE_KEY to retrieve the registry key for a selected device profile.

If the Windows Mobile device is connected remotely, the service manager passes the ISF_REMOTE_CONNECTED bit flag to IReplStore::Initialize. When this flag is set, the desktop provider must not display any blocking user interface, such as a message or dialog box, because the user is not present at the desktop computer to respond. Instead, the desktop provider should accept all default actions without prompting.

If the service provider returns an error in IReplStore::Initialize, the service manager automatically displays an error message. If you would rather have the desktop provider handle the error message, return RERR_NO_ERR_PROMPT.

The service manager usually calls IReplStore::Initialize immediately after a connection event occurs. However, the service manager can call other methods first, such as when a user changes the synchronization options for a disconnected Windows Mobile device.

The following table shows the methods that can be called before IReplStore::Initialize.

Method Description

IReplStore::GetStoreInfo

Obtains information about a store, which is displayed in the ActiveSync Option dialog box.

IReplStore::GetObjTypeUIData

Obtains information about an object type, which is displayed in the ActiveSync main menu.

IReplStore::GetFolderInfo

Obtains the folder handle, HREPLFLD, to the desktop provider.

IReplStore::ActivateDialog

Instructs the service provider to display the options dialog for a particular object type.

IReplStore::ObjectToBytes

Converts a HREPLITEM handle or a HREPLFLD handle to a byte sequence.

IReplStore::BytesToObject

Converts a byte sequence to a HREPLITEM handle or a HREPLFLD handle.

IReplStore::ReportStatus

Optional. Informs the desktop provider about events that are taking place.

See Also

Concepts

Developing the Desktop Provider