开发者

Is there any macro to differentiate between WinCE emulator and WinCE device?

开发者 https://www.devze.com 2023-01-17 12:15 出处:网络
I need to perform some file operations on WinCE platform. The paths of file differ in Device compared to Emulator.

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 define开发者_JS百科d(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 ?


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").

0

精彩评论

暂无评论...
验证码 换一张
取 消