The ActiveSync Manager

The ActiveSync Manager (or just ActiveSync) is an application that runs on both your desktop and Pocket PC device, and is responsible for maintaining the partnerships between them (see Figure 9.1). It also handles the connection (over USB, Network, and so on), synchronization, and the replication of data between a device and its desktop counterpart.

Figure 9.1. The desktop ActiveSync Manager


There are two main components to ActiveSync: the Service Manager and Service Providers.

The Service Manager is responsible for comparing data on the Pocket PC device with that on the desktop. Once it has looked at the data on both for a particular application (and based on synchronization rules the user has configured), it will update them with the most recent information. Think of it as the synchronization engine for your data (see Figure 9.2). The ActiveSync Manager is the application that an end user works with to configure service providers and their configuration options. In addition, ActiveSync is also responsible for connectivity services, either locally or remotely, that can be established over a serial, infrared, Ethernet, or wireless connection.

Figure 9.2. ActiveSync synchronization options


The other half of ActiveSync is the Service Providers. A service provider is a COM component that is registered within the Service Manager and provides specific synchronization functionality for a particular application. For example, applications such as Pocket Outlook, Inbox, Pocket Word, and Pocket Excel all have ActiveSync Service Providers. A typical service provider will consist of two modules: one that runs on the desktop and one that runs on a Pocket PC device.

Another type of service provider that ActiveSync will also use is File Filters. File Filters run on the desktop and are used to handle the conversion of a particular file type when copied between a device and a desktop computer. File Filters are also registered with the Service Manager.

Using the ActiveSync Manager

The ActiveSync Manager is typically launched when a connection is established to a Pocket PC device. If you need to manually execute it, the safest way to find out where it is located is by looking in the desktop's registry. You will need to examine the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows CE Services and look at the InstalledDir subkey value. This will contain the path that ActiveSync was installed in. You can then run the wcesmgr.exe executable to start the Service Manager.

When starting ActiveSync, you can run it with any of the command-line options described in Table 9.1.

Table 9.1. ActiveSync Manager Command-Line Options




No command-line parameter. This will just run ActiveSync without displaying the status window.


Shuts down ActiveSync while keeping a connection active.


Starts ActiveSync and makes the status window visible.


Starts ActiveSync and displays the Options dialog box.


Starts ActiveSync and immediately synchronizes data with the connected device.

Let's take a look at how you can use the CreateProcess() function to start ActiveSync on your desktop:

// Open the registry
TCHAR tchPath[MAX_PATH+1] = TEXT("\0");
TCHAR tchActiveSyncInsPath[MAX_PATH+1] = TEXT("\0");

wsprintf(tchPath, TEXT("SOFTWARE\\Microsoft\\Windows CE
if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, tchPath, 0, KEY_READ,
   &hKey) != ERROR_SUCCESS)
   return FALSE;

// Get the path to where ActiveSync is installed
if(RegQueryValueEx(hKey, TEXT("InstalledDir"), NULL, NULL,
    (LPBYTE)&tchActiveSyncInsPath, &dwSize) !=
   return FALSE;


// Launch it
_tcsncat(tchActiveSyncInsPath, TEXT("\\wcesmgr.exe"),

memset(&si, 0, sizeof(STARTUPINFO));
memset(&pi, 0, sizeof(PROCESS_INFORMATION));

si.cb = sizeof(STARTUPINFO);
CreateProcess(tchActiveSyncInsPath, NULL, NULL, NULL, FALSE,

Note that ActiveSync uses a proprietary protocol known as Direct Cable Connect Manager (DCCM) to send commands, replicate information, and communicate with a connected device. In order for ActiveSync to work properly, you need to ensure that the TCP/IP ports 990, 999, 5678, and 5679 are available for it to use.

More information about configuring a system to use DCCM can be found in the Microsoft Knowledge Base article Q259369, located at;en-us;259369.