Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
4/8/2010

This sample is called EdbRapi. It demonstrates how to use RAPI to access EDB databases. It also provides a reusable libary for accessing EDB databases remotely on the Windows Mobile device.

This application mounts an EDB database volume, creates an EDB database and populates it with the names, size and time of the files or directories in the root directory of the device.

The database is then closed and re-opened sorted by file or directory names. The content of the database in the created volume is printed. Finally, the database will be deleted and the volume will be unmounted.

Feature Area

Relevant APIs

Usage

To run the code sample

  1. Navigate to the solution file (*.sln), and double-click it. By default, the solution file is copied to the following folder:

    C:\Program Files\Windows Mobile 6.5.3 DTK\Samples\Common\CPP\Win32\Rapi\edbrapi

    Microsoft Visual Studio launches and loads the solution.

  2. Navigate to Tools -> Options, and expand Projects and Solutions, and click VC++ Directories

  3. In Show directories for:select Include files.

  4. For Win32 and mobile deviceplatform, add the path to the ActiveSync include directory. If you accepted the defaults when installing the SDK, then the new directory will be C:\Program Files\Windows Mobile 6.5.3 DTK\Activesync\inc.

  5. In Show directories for:select Library files.

  6. For Win32 and mobile device platform, add the path to the ActiveSync library directory. If you accepted the defaults when installing the SDK, then the new directory will be C:\Program Files\Windows Mobile 6.5.3 DTK\Activesync\Lib.

  7. Right click propertiesfor the "EDBRapi" Solution, and select Configuration Properties. Set the platform for Client and Clientlib as WIN32; the platform for EDBRapiServer and ServerSetup as the mobile platform you choose, either Windows Mobile Professional or Windows Mobile 6 Standard

  8. Navigate to "Build", and click "ReBuild Solution" to compile the executable file

  9. Go to the main output directory of ServerSetup, and copy ServerSetup.CAB to the device, and run it. (You may use Remote File Viewer to copy the file to a location you can access on the device or emulator). Running the CAB will copy the signed version of EdbRapiServer.dll to the \windows folder on the device. The Setup DLL included in the ServerSetup CAB needs to run with privileged rights. If you will run this CAB on a Windows Mobile ered device, make sure to sign the CAB with a certificate on the privileged certificate store.

  10. Make sure your device/emulator is connected to ActiveSync before running the application.

Development Environments

SDK:Windows Mobile Professional SDK and Windows Mobile Standard SDK

Development Environment:Visual Studio 2005 or 2008.

ActiveSync:Version 4.5.

Remarks

If you have not installed the SamplePrivDevelopercertificate, you will need to do that so that your dll and cab projects are signed correctly.

To install the certificate from the windows desktop

  1. Click Start.

  2. Click Run

  3. Type in the path to SamplePrivDeveloper.pfx. By default, this is installed in the followinf directory

    C:\Program Files\Windows Mobile 6.5.3 DTK\Tools\Security\SDK Development Certificates.

  4. Click OK. The Certificate Import Wizard should appear.

  5. Click Next. The path to the certificate should be filled in for the File name.

  6. Click Next.

  7. Click Next. You do not need a password.

  8. Click Next. This selects the default options: Automatically select the certificate store based on the type of certificate.

  9. Click Finish.

See Also