在Visual Studio中,通过Project-属性-Character Set,可以修改项目的字符集选项,由UNICODE修改为NotSet、MultiByte-Character Set后,界面上控件没有之前美观了。
解决方案:
打开项目中的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
#endif
将第一行的#ifdef _UNICODE和最后一行的#endif注释掉,即可。中间的代码就是控制界面效果的代码。
暂无评论内容