views:

17

answers:

1

Is there a preprocessor value I can use to detect when the program is being compiled for Windows Mobile 6.5.3? For example, I can use #if (_WIN32_WCE >= 0x501) to compile the code for Windows Mobile 5 and later, or #if _WIN32_WCE >= 0x502 to compile the code for Windows Mobile 6.

There are some new API that exist in Windows Mobile 6.5.3 that do not exist in Windows Mobile 6. I would like to make sure the WM 6.5.3 calls are not being compiled into the WM 6, WM 5, and Pocket PC 2003 build configurations.

A: 

The version refers to the Windows CE version, which I don't believe matches the Windows Mobile version.

From what I recall, this version define is in the form of 0xXYZ where X is the major version, Y is the minor version, and Z is the revision. So if 0x502 refers to Windows Mobile 6 or later, it would mean Windows Mobile 6 runs on Windows CE 5.0.2.

You'll need to figure out which version of Windows CE is used by Windows Mobile 6.5.3, if it uses a different version, and compare the define to that. If it doesn't use a different version of Windows CE (and I think this is the case), I think you're out of luck.

I don't think there's any sort of preprocessor to target specific versions of Windows Mobile, so you'd have to make two separate builds and use your own define. As far as I know, you can only get the Windows Mobile version at runtime, and doing so isn't very straight forward.

dauphic