CPDB.Net

https://cpdb.ppcompiler.org/

1- Add CPDB support to your application (CPDB library)

C language



Introduction

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.


 

Install CPDB on the device

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.


 

On the POSE emulator :

 

On your Palm device :

 

With Falch.net DeveloperStudio :

It's very easy to install CPDB library each time you run your test or debug session.



Do the same way to install a CPDB database for use with CPDB.


 

Modify your source code

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.


 

Conclusion

Four line to add, your application is CPDB ready !