zoukankan      html  css  js  c++  java
  • 多字节字符与界面 manifest

    之前把调试项目的时候软件界面变成了很古板的那种界面,后来查了一会发现因为字符集的改变,个人习惯统一我一般用同一种字符集,虽然Unicode只涉及语言问题,不过总感觉它占内存,用非字符集,搜索发现将代码中的#ifdef __UNICODE去掉就可以,注意后面的#endif。

     1 #ifdef _UNICODE
     2 #if defined _M_IX86
     3 #pragma comment(linker,"/manifestdependency:"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'"")
     4 #elif defined _M_IA64
     5 #pragma comment(linker,"/manifestdependency:"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'"")
     6 #elif defined _M_X64
     7 #pragma comment(linker,"/manifestdependency:"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'"")
     8 #else
     9 #pragma comment(linker,"/manifestdependency:"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'"")
    10 #endif
    11 #endif

    不过在搜的过程中碰到了manifest,就顺便了解了一下。

    什么是vs 程序的manifest文件

    manifest 是VS程序用来标明所依赖的side-by-side组件,如ATL, CRT等的清单。

    为什么要有manifest文件

    一台pc上,用一组件往往会有不止一个版本(c:/windows/winsxs或系统目录下),程序在加载的时候,不知加载哪个,于是manifest文件来指明。

     

    1. Manifest是个XML的描述文件,对于每个DLL有DLL的Manifest文件,对于每个应用程序Application也有自己 的Manifest。

    2. 对于应用程序而言,Manifest可以是一个和exe文件同一目录下的.manifest文件,也可以是作为一个资源嵌 入在exe文件内部的(Embed Manifest)。

    3. XP以前版本的windows,会像以前那样执行这个exe文件,寻找相应的dll,没有分别Manifest只是个多余的文件或资源,dll文件会直接到system32的目录下查找,并且调用。

    4. 而XP以后的操作系统,则会首先读取Manifest,获得exe文件需要调用的DLL列表(此时获得的,并不直接是DLL文件的本身的位置,而是DLL 的manifest)操作系统再根据DLL的Manifest去寻找对应的DLL<因此就可能区别 不同版本的同一个DLL文件,或是指定一个程序本 身Isolated的DLL>。

    5. 如果程序是静态链接的,没有使用dll,只使用了操作系统核心的 Kernel32.dll, User32.dll, Ole32.dll, 或ShDocVW.dll 等,project的设置必须是Use Standard Windows Libraries、Not Using ATL、No Common Language Runtime support,那么你可以不需要考虑Manifest 可以关掉它。

  • 相关阅读:
    AT&T不能访问公司网络
    尝鲜:windows 7 来了
    .net控件编程 资料篇
    Annual part 2009
    从Visual studio 2005移出Visual Assist
    不能在IIS 5.1增加应用程序扩展的BUG
    The problem of the user is not associated with a trusted sql server connection 混合登录选项设置的问题
    让我们难忘的那些歌曲
    分享利用VPC防止病毒软件的进入你的windows电脑
    杂读 May 12,2008
  • 原文地址:https://www.cnblogs.com/quantumplan/p/3702084.html
Copyright © 2011-2022 走看看