2011-12-05 54 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