Is there any macro to differentiate between WinCE emulator and WinCE device?
-
04-10-2019 - |
Question
I need to perform some file operations on WinCE platform. The paths of file differ in Device compared to Emulator. So i need to choose file according to the environment, like below.
#if defined(WINCE_EMULATOR) //This macro is just for illustration
#define path ".\Storage Card\\1.txt" //Emulator configuration
#else
#define path "\\My Documents\Storage Card\\1.txt" //Device configuration
#endif
Is there any macro to differentiate between WinCE emulator and WinCE device ?
Solution
There isn't a macro to check this, and couldn't be - the compiler has no idea what target you're going to run on. You have to do a run-time check using something like SystemParametersInfo with SPI_GETOEMINFO and look for emulator-specific text (IIRC it returns something like "Microsoft DeviceEmulator").
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow