通过 COM 在 64 位进程中使用 32 位 DLL [英] Utilizing a 32-bit DLL in a 64-bit process via COM

查看:31
本文介绍了通过 COM 在 64 位进程中使用 32 位 DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以前段时间我正在调查一个我知道很快就会出现的问题.我们有一个链接到某个库的 32 位版本的 DLL.我们没有这个库的 x64 版本,我们也没有替换它的实用选项.

So some time ago I was investigating an issue that I knew would be coming up soon. We have a DLL that links to 32-bit versions of a certain library. There is no x64 version of this library available to us and we have no practical options in regards to replacing it.

当我进行这项初步调查时,我发现一两篇文章描述了一种方法,通过该方法,64 位进程可以通过 COM服务器"利用 32 位 DLL (Windows).不幸的是,我丢失了我保存的链接,现在我已经搜索了一个多小时但没有运气.

When I performed this initial investigation I found an article or two describing a method by which a 64-bit process can utilize a 32-bit DLL (Windows) via a COM "server". Unfortunately I lost the links I had saved and I have now been searching for over an hour with no luck.

这里有人熟悉我描述的过程吗?我一辈子都记不起我用哪个神奇的咒语在搜索中拉出正确的结果,当然,现在是实施时间.在此先感谢你们提供的任何帮助,在此期间我会继续搜索.

Is anyone here familiar with the process I am describing? I can't for the life of me remember which magical incantation I used to pull up the correct result in a search and, of course, it is now implementation time. Thanks in advance for any help you guys can offer, I will continue searching in the meantime.

推荐答案

这可能还不够,但它可能会让你开始:进程互操作性

This may not be enough, but it might get you started: Process Interoperability

在 64 位 Windows 上,进程外 32 位 COM 服务器可以与 64 位客户端通信,进程外 64 位 COM 服务器可以与 32 位客户端通信.因此,如果您有一个不支持 COM 的 32 位 DLL,您可以将其包装在进程外 COM 服务器中,并使用 COM 来编组进出 64 位进程的调用.

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.

从 64 位代码访问 32 位 DLL

如果您有无法重写的 32 位 DLL,则将 32 位 Windows 应用程序迁移到 64 位计算机可能会出现问题.Mike Becker 向您展示了如何使用内置 IPC 机制从 64 位代码访问 32 位 DLL...

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...

这篇关于通过 COM 在 64 位进程中使用 32 位 DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆