c++ - 通过 COM 在 64 位进程中使用 32 位 DLL

标签 c++ com 32bit-64bit

所以前段时间我正在调查一个我知道很快就会出现的问题。我们有一个链接到某个库的 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/

相关文章:

c++ - C与C++,void **指针的处理

c++ - 未使用的函数参数是否总是被实例化?

c++ - 是否有将 REFIID 转换为有用名称的操作系统功能?

javascript - 在 32 位和/或 64 位 firefox(版本 25.0.1)上使用 js-ctypes 的 firefox 扩展

c++ - 使用带有字符串参数的 Variadic 模板函数调用的正确方法 c++

c++ - 多文件 <iostream> 错误 LNK2005 in VS2015 with/Za

c++ - 如何对 COM 中的方法执行返回类型?

c# - 使用 Interop.MODI 引发 0x80040154 异常

c# - 32 位 C# 应用程序如何利用 64 位 DLL

gcc - 从cygwin64编译32位代码