积极答复者
对一段预编译代码的不理解

问题
-
使用VS 2005新建一个单文档工程,其stdafx.h会有下面一段代码:
#ifdef _UNICODE #if defined _M_IX86 #pragma comment(linker,"/manifestdependency:/"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'/"") #elif defined _M_IA64 #pragma comment(linker,"/manifestdependency:/"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'/"") #elif defined _M_X64 #pragma comment(linker,"/manifestdependency:/"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'/"") #else #pragma comment(linker,"/manifestdependency:/"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'/"") #endif
据网上的一种说法,该段代码具有打开xp界面风格的作用,具体见:
VC6风格转XP风格界面的两种方法
我比较奇怪的是为何这段代码要指定unicode字符集下才起作用?去掉#ifdef _UNICODE 会有副作用吗?
前无古人,后无来者
答案
-
一般的,_UNICODE和UNICODE都会同时定义的,要么都定义,要么一个也不定义。
Visual C++ enthusiast, like network programming and driver development. At present is being engaged in the WinCE/Windows Mobile platform embedded development.
- 已标记为答案 Helen Zhao 2012年6月11日 3:17
全部回复
-
一般的,_UNICODE和UNICODE都会同时定义的,要么都定义,要么一个也不定义。
Visual C++ enthusiast, like network programming and driver development. At present is being engaged in the WinCE/Windows Mobile platform embedded development.
- 已标记为答案 Helen Zhao 2012年6月11日 3:17
-
http://blog.csdn.net/kakaxisama/article/details/5221421
参考这篇blog,希望对您有帮助~
Visual C++ enthusiast, like network programming and driver development. At present is being engaged in the WinCE/Windows Mobile platform embedded development.
- 已建议为答案 Helen Zhao 2012年6月11日 3:17
-
http://blog.csdn.net/kakaxisama/article/details/5221421
参考这篇blog,希望对您有帮助~
Visual C++ enthusiast, like network programming and driver development. At present is being engaged in the WinCE/Windows Mobile platform embedded development.
非unicode下使用一般也没啥问题,可能是在某种情况下才会异常。前无古人,后无来者