PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

If Using Smartphone

This may seem daft

when i compile for desktop or PPC
i use this definition
but what could i use for smartphone.?

#ifdef _WIN32_WCE
<a href="http://www.google.com/search?hl=en&lr;=&ie;=ISO-8859-1&q;=smartphone+%23ifdef">Google</a>, <a href="http://www.smartphonedn.com/qa/checkos.html">answer 7</a>?
Peter Balogh · 02 Oct 2003, 14:53 UTC
MS Smartphone is just another Windows CE variant, so _WIN32_WCE is defined as well.
Code:

#if _WIN32_WCE==300
#pragma message ( "Compiling for PocketPC (3.0, using GAPI)" )
#define USE_GAPI
#elif WIN32_PLATFORM_WFSP=100
#pragma message ( "Compiling for SmartPhone (using GAPI))" )
#define USE_SMART

#endif


Ive tried this above but i only get the Compiling ppc message though the echo at the end of my build gives the smartphone


Where am i wrong
You could always add your own definition to your project settings. Something like _WIN32_WCE_PHONE

Dan East
freakedout wrote:
Code:

#if _WIN32_WCE==300
#pragma message ( "Compiling for PocketPC (3.0, using GAPI)" )
#define USE_GAPI
#elif WIN32_PLATFORM_WFSP=100
#pragma message ( "Compiling for SmartPhone (using GAPI))" )
#define USE_SMART

#endif

Ive tried this above but i only get the Compiling ppc message though the echo at the end of my build gives the smartphone

Where am i wrong


You're comparing WinCE to SmartPhone. The SmartPhone runs on WinCE, so the first case will always be true and the second case won't be called.

You want to compare PocketPC to SmartPhone.
Code:
#if defined(WIN32_PLATFORM_PSPC)
// It's a Pocket PC
#elif defined(WIN32_PLATFORM_WFSP)
// It's a SmartPhone
#endif

Note I haven't tried this myself, but that's what the website seems to be saying. See the second block of code for the example. It even checks for different versions of Pocket PC.

-John
Syntax error? :

_WIN32_WCE==300 (correct)
WIN32_PLATFORM_WFSP=100 (incorrect)

Hence compiler error?

As Presto said, copying their code style would seem prudent. The compiler may get upset trying to compare non-existant #defined variables.
thanks for the help ive got it working now, i was tired yesterday and really i should have read the setup.

thanks once again