2011-12-05 55 views
0

我遇到了一个我创建的32位ATL dll的问题---每当我在Windows XP上使用dll(32位)电脑它没有任何警告崩溃。我认为这个问题与我编译dll的Windows版本有关,但我不确定。只是一点点的历史:VC++ ATL DLL崩溃 - 可能与32/64位问题有关

我最初在Visual Studio 2008的Windows XP(32位)盒子上开发了这个DLL。这个版本的DLL在Windows XP(32位)和Windows 7(32位和64位)。然后,我得到了一个Windows 7(64位)和Visual Studio 2010的新开发盒。我将VS2008项目转换为VS2010,进行编译,它在Windows 7(32位和64位)机器上完美运行;但是,当我在Windows XP(32位)上运行它时,它会崩溃。

有趣的是,我能够成功regsv32 XP的机器上的dll,但是当我跑依赖学步车,它说,它缺少一堆文件:

api-ms-win-core-console-l1-1-0.dll
api-ms-win-core-datetime-l1-1-0.dll
api-ms-win-core-debug-l1-1-0.dll
api-ms-win-core-delayload-l1-1-0.dll
api-ms-win-core-errorhandling-l1-1-0.dll
api-ms-win-core-fibers-l1-1-0.dll
api-ms-win-core-file-l1-1-0.dll
api-ms-win-core-handle-l1-1-0.dll
api-ms-win-core-heap-l1-1-0.dll
api-ms-win-core-interlocked-l1-1-0.dll
api-ms-win-core-io-l1-1-0.dll
api-ms-win-core-libraryloader-l1-1-0.dll
...any many more of the same

我复制所有这些文件从自己的计算机到Windows XP箱,现在的Dependency Walker告诉我:

Error: The Side-by-Side configuration information for "c:\documents and settings\poibri01\desktop\distributable\WERUI.DLL" contains errors. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem (14001).
Error: Modules with different CPU types were found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.

我不知道在哪里可以从这里走。谁能帮我?

编辑

  1. 的Microsoft Visual C++ 2010可再发行组件包(x86)安装在Windows XP计算机上。
  2. 我正在编译DLL作为32位版本(而不是调试)。

回答

1

这些DLL我认为是specific to Windows 7,所以他们不会在XP上工作。我怀疑,要么你在manifest文件东西是特定于Windows 7或正在_WIN32_WINNTWINVER,比如指定最低版本看http://msdn.microsoft.com/en-us/library/aa383745%28v=vs.85%29.aspx

,看看有什么在manifest文件,使用mt工具:

mt -inputresource:mydll.dll;#1 -out extracted.manifest 
+0

谢谢,the_mandrill ...我认为你是在解决方案。在我的项目WINVER被设置为0x0600(Windows Vista),所以我将它改为0x0501(Windows Server 2003,Windows XP)。这里是清单文件的输出:<?xml version ='1.0'encoding ='UTF-8'standalone ='yes'?> HydroPowerDeveloper

+0

然而,当我在DLL运行依赖学步车,它仍然指的是Windows 7的dll文件......你有什么想法? – HydroPowerDeveloper

+0

我忘了补充说dll在Windows XP上仍然崩溃。 – HydroPowerDeveloper