Compiling with x64 in Windows, wrong official IBM recommendations

When I compile a Notes C API program using Windows 32 bits, I only need to define “W32” in the preprocessor definitions. Should I keep defining W32 in Windows x64? If I only define W64 then I get errors saying that I must specify the operating system…

Also, reading the “Lotus C API 8.0 user guide” and opening the “Porting 32bit Domino applications to 64bit Domino” there are things that seem to be wrong:

IBM says:

“Domino handles are 32bit on domino 32 and 64 platforms. However, windows handles are 64bit on 64bit windows. So please use DHANDLE instead of system HANDLE which is 32bit on all 32 and 64 bit platforms.”

however if I compile my code in x64 then:

sizeof(DHANDLE)=8

and in Win32:

sizeof(DHANDLE)=4

So “32bit on all 32 and 64 bit platforms” is invalid.

Also IBM says:

Don’t use native data type long as this is 32bit on 32bit and 64bit on 64bit systems.

Testing here, sizeof(long) is 4 bytes in both x86 and x64

Also seeing the .mak files of the API x64 I see that in the .mak files IBM says

-DHANDLE_IS_4BITS

So my question is “Should I use this preprocessor definition too?” And it this case 4bits has no sense… maybe it is -DHANDLE_IS_64BITS or -DHANDLE_IS_4BYTES or -DHANDLE_IS_8BYTES

Which one should I use if any?

Thanks

Subject: got it ok…

still on going tests but - compiles & run fines after a lot of crash without the ND64.

PREPROCESSOR :

W64

W32

ND64

_CRT_SECURE_NO_WARNINGS

ND64 - is defined into GLOBAL.H

#if defined(ND64) || defined(NDUNIX64)

/* this is defined here for all platforms as this is used somewhere in the pack */

#ifdef HANDLE_IS_64BITS

	#if defined(UNIX)

		typedef unsigned long DHANDLE;	/* 64-bit HANDLEs */

	#else

		typedef unsigned long long DHANDLE;	/* 64-bit HANDLEs on Windows */

	#endif