CPDB is a Palm shared library. To add CPDB support to your C application, you must only open the library, it's very easy and some Macro are provided to simplify the manipulation.
The CPDB library, a little prc file, must be installed with your application. For your testing session you must install the lib on the POSE Emulator, like another application.
- Run POSE emulator
- Drag & drop the CPDBSTD.PRC file on POSE emulator
- Save the session with : right-clic/Save on POSE emulator
- Run Hotsync Install tool (in the Palm Desktop section of your program menu)
- Clic on [Add] button, browse to select "CPDBSTD.PRC" in your cpdb.net installation directory
- Clic on [Done] button
- Hotsync the Palm device
It's very easy to install CPDB library each time you run your test or debug session.
- Open your project and clic on [Project/Properties] menu
- Choose you settings on the combo box, most of time you choose "Debug" settings
- Clic on the [Debug] tab
- On the right of the "Load Additional Applications" field, clic on the [Add] button (the paper bitmap button)
- Browse to select "CPDBSTD.PRC" in your cpdb.net installation directory
- Clic on [OK], it's done !
Do the same way to install a CPDB database for use with CPDB.
Some addition must be done on your main.c and your application header file.
In main.c :
- Add the following line before the first function of your code :
// #include ... CPDB_USELIB // First function |
Note : do not type a ";" on the end.
- Add the following line in your "StartApplication" or PilotMain* function :
static int StartApplication(void) { CPDB_OPENLIB FrmGotoForm(frmMain); return 0; } |
* Before the first form is opened
Note : do not type a ";" on the end.
- Add the following line in your "StopApplication" or PilotMain* function :
static void StopApplication(void) { FrmCloseAllForms();
CPDB_CLOSELIB } |
* Before the end of execution, after the "EventLoop" and AFTER closing forms (by this way, you can close your databases in the FrmClose event).
Note : do not type a ";" on the end.
In the application header file :
- Add the following lines in any place :
#include "CPDBSTD.h"
CPDB_EXTERN_USELIB |
You need to put the "CPDBSTD.h" file in your project directory. You can find this file in the CPDB installation directory.
Note : do not type a ";" on the end of the CPDB_USELIB line.
Four line to add, your application is CPDB ready !
Creation date : 01/10/2003 @ 05:58
Last update : 01/10/2003 @ 08:53
Category : CPDB library
Page read 10041 times
|