manifest好像是叫做信息列表文件 With Windows XP, the assembly is described by a manifest; the registry is no longer relied upon for storing and accessing the COM activation data. This allows components to now be isolated. Shared assemblies can also be serviced, so that applications can use the latest version. The table below illustrates the advances with Windows XP in this regard over Windows 2000. (For more information on side-by-side component sharing in Windows 2000, see Implementing Side-by-Side Component Sharing in Applications (Expanded)). (MSDN:ms-help://MS.VSCC/MS.MSDNVS.2052/dnwxp/html/sidexsidewinxp.htm)
你收索一下帖子
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="X86"
name="Microsoft.Winweb.<Executable Name>"
type="win32"
/>
<description>.NET control deployment tool</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
1 24 "xp.txt"
把那段脚本写道这个xp.txt里,放到这个xp.rc相同的目录下,其实这段脚本的文件名叫什么都无所谓,只要xp.rc里的资源描述正确,编译时rc.exe能找到就行了。hhhh.mani...随你。
资源加好了就行了,但是vb6的程序,如果不初始化通用控件库,启动时就有初始化错误,所以要调用initcommoncontrol,如果是高版本的我就不知道了,我没用过.net:>
在你的窗体中先加入入下代码:
====================================================================
Private Declare Sub InitCommonControls Lib "comctl32.dll" ()Private Sub Form_Initialize()
InitCommonControls
End Sub
====================================================================
记住:千万不要在Form_load()事件下写InitCommonControls这句话,这样你的窗体会启动不了.
然后需要为你的程序建立一个和你的.exe同名的.exe.manifest文件(列如:如果你最后编译好的文件名为Example.exe,则建立一个文件名为Example.exe.manifest的文件)记住此文件必须存在于和你Exe文件的同一目录下.
还是以Example.exe为例,则这个Example.exe.manifest的文件的内容如下:
====================================================================
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="X86"
name="CompanyName.ProductName.YourApp"
type="win32"
/>
<description>Your application description here.</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
====================================================================
(哦,原来是XML啊)将以上内容保存为Example.exe.manifest好以后就OK了,在WinXP下运行你的程序就会得到XP风格的窗体和控件.
Good Luck!!!
实际上是这样的,程序会先找manifest文件,如果有这个文件,就按照这个文件的规则办事,如果没有这个文件就找资源,如果有资源就按照资源办事,如果连资源也没有,那就是普通界面了。
那么,就是说windows下程序原本就在读这个文件,那么这个文件到底是干什么用的?还有别的脚本吗?有别的用途吗?好像在别处也没见有过什么介绍。这个资源又是怎么回事,为什么这么特殊呢?
vc6里面不会这样。
外接一般不大用的。
做出来的控件才几k
买了vs.net,查过新版MSDN了,两种方法确实都是正着,只是还没看到XML脚本到底是起个什么作用
With Windows XP, the assembly is described by a manifest; the registry is no longer relied upon for storing and accessing the COM activation data. This allows components to now be isolated. Shared assemblies can also be serviced, so that applications can use the latest version. The table below illustrates the advances with Windows XP in this regard over Windows 2000. (For more information on side-by-side component sharing in Windows 2000, see Implementing Side-by-Side Component Sharing in Applications (Expanded)).
(MSDN:ms-help://MS.VSCC/MS.MSDNVS.2052/dnwxp/html/sidexsidewinxp.htm)