Initializing the Store
A version of this page is also available for
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.
To access the profile information for a device
Call CeGetDeviceId to retrieve the registry key for a connected Windows Mobile device profile.
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 |
---|---|
Obtains information about a store, which is displayed in the ActiveSync Option dialog box. |
|
Obtains information about an object type, which is displayed in the ActiveSync main menu. |
|
Obtains the folder handle, HREPLFLD, to the desktop provider. |
|
Instructs the service provider to display the options dialog for a particular object type. |
|
Converts a HREPLITEM handle or a HREPLFLD handle to a byte sequence. |
|
Converts a byte sequence to a HREPLITEM handle or a HREPLFLD handle. |
|
Optional. Informs the desktop provider about events that are taking place. |