NO

Author Topic: Lotus Notes C API with Pelle's C IDE (Version 5)  (Read 5248 times)

StigK

  • Guest
Lotus Notes C API with Pelle's C IDE (Version 5)
« on: August 22, 2008, 10:27:57 AM »
Hi All...

If anyone ever has tried to include the Lotus Notes C API this is a quick 'how to' make it work in Pelle's C (version 7.0.1 of the C API is the one referred here).

First, add in the Notes API LIB and INCLUDE files into the system or add them into the IDE.

The following macros should be entered in the compiler properties in the field 'Define preprocessor symbols' (Project | Project Options | Compiler): _WIN32,_WINNT,NT
Set the warning level to 2 (at least initially)
Remember to enable Microsoft Extensions tick box as well.

Under the Linker tab, add in notes.lib in the 'Library and object files' (I've also added user32.lib, but it's not really needed)
Remember to set the wanted subsystem as well according to which windows version.

That was the 'easy' part, and now comes the 'neck pain':
- There is a file called global.h in the include area. This one needs to get edited in the following way for certain declarations, since they get 'double defined' and for a few of them it ends up as an error:
- BYTE
- LONG
- BOOL
- LOBYTE
- HIBYTE
- LOWORD
- HIWORD
- HANDLE

Example of the original definitions:
   typedef unsigned char BYTE;
   #if defined(LONGIS64BIT)
      typedef int LONG;
   #else
      typedef long LONG;
   #endif

...

It should be modified to something similar to this:
   #if !defined(BYTE)
      typedef unsigned char BYTE;
   #endif
   #ifndef LONG
      #if defined(LONGIS64BIT)
         typedef int LONG;
      #else
         typedef long LONG;
      #endif
   #endif

...

After this header file has been modified I have (so far) not run into compiler / definition errors...

Good luck!

Stig