Installation and Registration

< BACK  NEXT >
[oR]

Installing an ActiveSync provider on a Windows CE device requires the following steps:

  1. Copy the DLL (for example, ASDevice.dll) into a suitable directory, such as "\Windows."

  2. Add an entry such as the following in the Synchronization registry key for your ActiveSync provider:

     HKEY_LOCAL_MACHINE   Windows CE Services     Synchronization       Objects         Appointment         Contact         Tasks         AsyncSample 
  3. Add a "Store" REG_SZ value to this key that contains the name of the .DLL that implements the ActiveSync provider. This should contain the fully qualified path if the .DLL is not in a standard location (such as the root or \Windows directory).

     AsyncSample   Store ASDevice.dll 

    Code to register the DLL is contained in an exported function called RegisterActiveSync in ASDevice.CPP. This function is called from the CLDevice application when the "Register" button is pressed.

  4. Copy the user interface application (for example, CLDevice.exe) into a suitable directory, such as the root, and run the application. This creates the database (ActiveSyncNotes) that will contain the synchronized items. With the sample application you should click the "Register" button to add the necessary registry items.

Installing the ActiveSync provider on the desktop PC requires more work, since a COM component is being registered. Here are the steps:

  1. Copy the application (CLDesktop.exe) into any suitable directory. Running this application will create the file "\ActiveSynNotes.dat" used to store the items. The user interface is almost identical to CLDevice.exe except that the "Register" button is replaced by "Refresh." Note that the list of items is not automatically updated, so you will need to click "Refresh" to ensure that the list is up to date.

  2. Copy the DLL (for example, ASDesktop.dll) into any suitable directory. You will need to register the COM component using the REGSVR32 application:

         REGSVR32 ASDesktop.dll 

As well as writing the standard registry entries for a COM component, entries specific to an ActiveSync provider are added. The code to add COM component entries is contained in the function DllRegisterServer in COMDLL.CPP. This calls the function RegisterActiveSync in COMDLL.CPP to add the ActiveSync provider registry entries.

A new key with the same name used on the Windows CE device (for example, "AsyncSample") is added in the following location:

 HKEY_LOCAL_MACHINE   Software     Microsoft       Windows CE Services         Services           Synchronization             Objects               Appointment               Contact               Task               AsyncSample 

It is important that the Windows CE device and desktop PC use the same key names, since this forms the link between the two sides of the ActiveSync provider. On the desktop PC the key contains the following values:

 AsyncSample   [Default]         "ActiveSync Example Provider"   Display Name      "TestNote"   Plural Name       "TestNotes"   Store             "Asdesktop.ActiveSyncEg"   Disabled          0 

The "[default]", "Display Name", and "Plural Name" REG_SZ string entries are used by ActiveSync to display information about the provider's status. The "Store" REG_SZ string contains the ProgID of the desktop COM Component that implements the ActiveSync provider. This string is the same value used when the DLL (for example, ASDesktop.DLL) registers its COM component. ActiveSync uses this value to locate the COM component and uses the COM registry entry "InProcServer" to find the fully qualified pathname for the DLL's location. The "Disabled" value (a REG_DWORD) has a value of 0 if the provider is active, or 1 if it is temporarily disabled.

AsyncSample is actually a folder, or object type (the terms mean the same). A store can implement multiple folders by having several object types (for example, Appointment, Contact, and Task) with the same store.

The desktop ActiveSync registry settings are copied into each desktop PC profile under the HKEY_CURRENT_USER key, using the same key names as described above. Now, when you run the ActiveSync user interface, you will see a new entry for this provider (Figure 17.2).

Figure 17.2. ActiveSync with an additional service
graphics/17fig02.gif

< BACK  NEXT >


Windows CE 3. 0 Application Programming
Windows CE 3.0: Application Programming (Prentice Hall Series on Microsoft Technologies)
ISBN: 0130255920
EAN: 2147483647
Year: 2002
Pages: 181

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net