所以前段时间我正在调查一个我知道很快就会出现的问题。我们有一个链接到某个库的 32 位版本的 DLL。这个库没有 x64 版本可供我们使用,我们也没有关于替换它的实用选项。
当我进行初步调查时,我发现了一两篇文章描述了 64 位进程可以通过 COM“服务器”使用 32 位 DLL (Windows) 的方法。不幸的是,我丢失了我保存的链接,现在我已经搜索了一个多小时,但没有成功。
这里有人熟悉我描述的过程吗?我这辈子都记不起我是用哪种魔法咒语在搜索中找到了正确的结果,当然,现在是实现时间了。提前感谢你们提供的任何帮助,同时我会继续搜索。
最佳答案
这可能还不够,但可以帮助您入门:Process Interoperability
On 64-bit Windows, an out-of-process 32-bit COM server can communicate with a 64-bit client, and an out-of-process 64-bit COM server can communicate with a 32-bit client. Therefore, if you have a 32-bit DLL that is not COM-aware, you can wrap it in an out-of-process COM server and use COM to marshal calls to and from a 64-bit process.
和Accessing 32-bit DLLs from 64-bit code
Migrating your 32-bit Windows application to a 64-bit machine can be problematic if you have 32-bit DLLs that you cannot re-write. Mike Becker shows you how you can access 32-bit DLLs from 64-bit code using built-in IPC mechanisms...
关于c++ - 通过 COM 在 64 位进程中使用 32 位 DLL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8660357/