Creating a Partnership

When a device is connected to a desktop running ActiveSync, the PC side of ActiveSync goes to work identifying the device. If the device's identity is not found, then the New Partnership dialog is displayed where the user is given an opportunity to choose between making a named partnership or synchronizing as a guest, as Figure 6-6 shows.

Figure 6-6. New Partnership Dialog. When the device does not have a partnership with the desktop, this dialog pops up upon cradling.


If the device is attached as a guest, then the ActiveSync functionality is limited. Guest capabilities include only backup and restore, browsing the device in Windows Explorer, accessing the network through the PC (known as ActiveSync pass-through), and software installation.

If a named partnership is formed, then the user is given an opportunity to select from the registered ActiveSync providers on the desktop. After selecting the providers, synchronization is performed and will thereafter be performed upon every connection (a partnership also has the guest mode functionality enabled). The provider selections and other synchronization options are stored in the registry in a key specific to the partnership. While the exact location of this information can be found by exploring the registry on the desktop and device, it is a best practice to use the CeUtil.dll, an unmanaged DLL (not a COM DLL). This DLL exposes functions such as CeSvcOpenEx and CeSvcSetString, which provide registry information specific to the device's locale and ActiveSync version (as these parameters will have a possible impact on partnership registry locations) and which can be called using the PInvoke functionality described in Chapter 11. With this, DLL developers can register desktop file filters and desktop synchronization partners, access device partnership settings that are used for both file filters and synchronization services, and add custom menu items.

Other issues to consider when using ActiveSync include the following:

  • There is little documentation and support for using the emulator with ActiveSync; however, there is an article on MSDN that talks about how to do this using a serial cable and two ports on your PC.[1]

    [1] This article is referenced in the "Related Reading" section at the end of this chapter.

  • ActiveSync does not natively synchronize between devices or with servers.

  • For a device to interact with ActiveSync on the desktop, ActiveSync has to be running on the desktop, which requires a user to be logged in to the desktop with ActiveSync installed and running.

  • Partnership information is stored in the HKEY_CURRENT_USER registry hive, which means that the partnership is tied to a specific Windows account and the user's registry.

  • A device can have a partnership with up to two desktops.

  • Wireless synchronization cannot occur until a partnership has been formed via a cradle.