关于 VS2008 字符集改用多字节字符集时,控件显示样式变为旧样式的问题的解决
问题描述:
再Win7系统下,用 VS2008建立工程后,默认的字符集为:使用 Unicode 字符集。由于该字符集使用比较麻烦,我常常将默认字符集该为:使用多字节字符集。但是当运行程序时发现程序中的很多控件的显示风格变为旧风格,很不好看。


解决方案:
在认真比对后,发现是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
#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
即去掉了是否使用_UNICODE的判断就可以了
摘自 mycaibo编程
相关新闻>>
- 发表评论
-
- 最新评论 进入详细评论页>>
今日头条
更多>>您可能感兴趣的文章
- 向Excel文档中嵌入VBA控件和UserForm并显示
- ASP.NET FormsAuthentication跨站点登录时绝对地址返
- ASP.NET生成高质量缩略图通用函数(c#代码)
- ASP.net页面中请求远程Web站点
- Spring.Net学习系列一: 统一异常处理
- Request.Cookies 和 Response.Cookies 的区别
- 用OpenXml在文档的尾部添加一个Rich Text Content Con
- 步步为营 SharePoint 开发学习笔记系列&nb
- ASP.NET之Gridview图解(1)
- 使用ASP.NET MVC3+EF+Jquery制作文字直播系统(一



