Depending on which platform you are targeting at compile time, you can use conditional compilation to include or exclude certain portions of code, as shown in the following code example.
Code Example
Copy Code | |
|---|---|
#ifdef WIN32_PLATFORM_PSPC
// Code for either Windows Mobile 6 Classic or Windows Mobile 6 Professional.
#if (WIN32_PLATFORM_PSPC = 400)
// Code for Windows Mobile 2003.
LoadString(g_hInst, IDS_PPC2003, szBuf, MAX_LOADSTRING);
#elif (WIN32_PLATFORM_PSPC = 310)
// Code for Pocket PC 2002.
LoadString(g_hInst, IDS_PPC2002, szBuf, MAX_LOADSTRING);
#endif
#endif // WIN32_PLATFORM_PSPC | |
Remarks
Using a conditional compilation approach, as opposed to runtime platform and version checking, results in a separate executable file for each targeted platform.
See Also