vs中,修改字符集配置后,界面效果发生改变,如何处理?

在Visual Studio中,通过Project-属性-Character Set,可以修改项目的字符集选项,由UNICODE修改为NotSet、MultiByte-Character Set后,界面上控件没有之前美观了。

null

解决方案:
打开项目中的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注释掉,即可。中间的代码就是控制界面效果的代码。

© 版权声明
THE END
喜欢就支持一下吧,技术咨询可以联系QQ407933975
点赞0 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容