积极答复者
VC6.0中的MFC程序能不能在Windows 7 中运行

问题
答案
-
.
[1] 你要确保你的MFC程序使用静态链接的MFC库, 否则就会因为目标操作系统上木有装MFC库而无法运行.
在项目属性中设置成"使用静态MFC库"
[2] 程序要在Win7上面正常运行而不被检查兼容性, 还需要在manifest中定义UAC支持.
添加manifest清单文件
VS2008前的版本需要添加的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="mulitray.exe.manifest"
type="win32"
/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>保存成UAC.manifest, 然后在rc文件中添加该文件.
- 已建议为答案 Helen Zhao 2012年3月26日 5:15
- 已标记为答案 Helen Zhao 2012年4月3日 1:36
全部回复
-
.
[1] 你要确保你的MFC程序使用静态链接的MFC库, 否则就会因为目标操作系统上木有装MFC库而无法运行.
在项目属性中设置成"使用静态MFC库"
[2] 程序要在Win7上面正常运行而不被检查兼容性, 还需要在manifest中定义UAC支持.
添加manifest清单文件
VS2008前的版本需要添加的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="mulitray.exe.manifest"
type="win32"
/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>保存成UAC.manifest, 然后在rc文件中添加该文件.
- 已建议为答案 Helen Zhao 2012年3月26日 5:15
- 已标记为答案 Helen Zhao 2012年4月3日 1:36