我在Windows 7 X64上使用VS2008 SP1A(9.0.30729.4148)的应用程序构建,不想在XP下启动。

消息是 The application failed to initialize properly (0x80000003). Click on OK to terminate the application.. 。我检查了 depends.exe 并发现 msvcr90.dll 确实尝试加载 FlsAlloc 从kernel32.dll-和flsalloc仅从Vista开始。我确定应用程序不使用它。

如何解决这个问题?

SXS软件包已经安装在目标计算机上 - 实际上,我拥有9.0 SXS的所有3个版本(初始版本,SP1和SP1+安全补丁)

申请已编译 _BIND_TO_CURRENT_VCLIBS_VERSION=1

我也定义了正确的目标Windows版本 stdafx.h

 #define WINVER 0x0500
 #define _WIN32_WINNT 0x0500

清单文件

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
 <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
 <security>
 <requestedPrivileges>
  <requestedExecutionLevel level="asInvoker" uiAccess="false" /> 
  </requestedPrivileges>
  </security>
  </trustInfo>
 <dependency>
 <dependentAssembly>
  <assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.30729.4148" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b" /> 
  </dependentAssembly>
  </dependency>
 <dependency>
 <dependentAssembly>
  <assemblyIdentity type="win32" name="Microsoft.VC90.MFC" version="9.0.30729.4148" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b" /> 
  </dependentAssembly>
  </dependency>
</assembly>

取决于

在地址0x00400000处开始“ C: Program Files App App.exe”(Process 0xa0)。成功挂钩模块。在地址0x7C900000上加载了“ C: Windows System32 ntdll.dll”。成功挂钩模块。在地址0x7C800000上加载了“ C: Windows System32 kernel32.dll”。成功挂钩模块。在地址0x785E0000上加载了“ C: Program Files App Mfc90.dll”。成功挂钩模块。在地址0x78520000上加载了“ C: Program Files App MSVCR90.DLL”。成功挂钩模块。在地址0x7e410000上加载了“ C: Windows System32 user32.dll”。成功挂钩模块。在地址0x77F10000上加载了“ C: Windows System32 gdi32.dll”。成功挂钩模块。在地址0x77F60000上加载了“ C: Windows System32 Shlwapi.dll”。成功挂钩模块。在地址0x77DD0000上加载了“ C: Windows System32 Advapi32.dll”。成功挂钩模块。在地址0x77E70000上加载了“ C: Windows System32 rpcrt4.dll”。成功挂钩模块。在地址0x77fe0000上加载了“ C: Windows System32 Secure32.dll”。成功挂钩模块。在地址0x77C10000上加载了“ C: Windows System32 MSVCRT.DLL”。成功挂钩模块。在地址0x5D090000上加载了“ C: Windows System32 Comctl32.dll”。成功挂钩模块。在地址0x76380000上加载了“ C: Windows System32 msimg32.dll”。成功挂钩模块。在地址0x7C9C0000上加载了“ C: Windows System32 Shell32.dll”。成功挂钩模块。在地址0x77120000上加载了“ C: Windows System32 oleaut32.dll”。成功挂钩模块。在地址0x774E0000上加载了“ C: Windows System32 ole32.dll”。成功挂钩模块。到达入口点。所有隐式模块都已加载。 dllmain(0x78520000,dll_process_attach,0x0012fd30)在“ c: program files app msvcr90.dll”中。 getProcAddress(0x7c800000 [C: Windows System32 kernel32.dll],“ flsalloc”)从“ C: Program Files App msvcr90.dll” at address 0x78543ACC和返回null。错误:找不到指定的过程(127)。 getProcAddress(0x7c800000 [C: Windows System32 Kernel32.dll],“ flsgetValue”)从“ C: Program Files App msvcr90.dll” at address 0x78543Ad9和返回的NULL。错误:找不到指定的过程(127)。 getProcAddress(0x7C800000 [C: Windows System32 Kernel32.dll],“ FlsSetValue”)从“ C: Program Files App MSVCR90.DLL” at address 0x78543Ae6和返回的NULL。错误:找不到指定的过程(127)。 getProcAddress(0x7C800000 [C: Windows System32 kernel32.dll],“ flsfree”)从“ C: Program Files App MSVCR90.DLL” at address 0x78543af3和返回null。错误:找不到指定的过程(127)。

我应该提到我已经安装了Windows SDK 7并配置为默认SDK。

有帮助吗?

解决方案 2

清单工具确实是越野车,唯一可靠的解决方案是不要将清单嵌入二进制文件中,因为嵌入几乎随机失败。在外面保持清单是丑陋的,但至少总是有效。

其他提示

我总是将清单嵌入到我的DLL中,从未遇到过问题。当我忘记嵌入清单时,我只会遇到一个问题。然后,它无法在Windows 2008上找到msvcr90.dll,但它在旧版本的Windows上工作,这使我感到困惑了一段时间。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top