64 位应用程序与 32 位进程通信 [英] 64 Bit application communicating with 32bit process

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

问题描述

我有使用 32 位第三方库的 32 位应用程序.现在我必须将我的应用程序设为 64 位,以便它可以利用 64 位地址空间(大内存).由于我无法将 32 位库加载到 64 位应用程序进程中,我正在考虑通过第三方库创建 32 位可执行包装器,并使用 IPC(命名管道/套接字)从我的 64 位应用程序进行通信.所以我的问题是他们这样做会有什么问题吗?此外,如果我必须在 64 位系统上安装我的应用程序,与我的应用程序相关的所有文件都将复制到c:Program Files"目录.现在我可以将我的 32 位第三方 exe 包装器保存在同一个c:Program Files"中还是我需要复制到c:Program Files(x86)"目录?

I have 32 bit application using 32 bit third party library. Now I have to make my application 64 bit , so that it can take advantage of 64 bit address space ( large memory ). Since I can not load 32bit library into 64bit application process, I am thinking of creating 32bit executable wrapper over third party library and communicate from my 64 bit app using IPC ( named pipe/socket ). So my question is would their any issue in doing so ?. Also if I have to install my application on 64 bit systems, all files related to my application will be copied to "c:Program Files" directory. Now can I keep my 32 bit third party exe wrapper in the same "c:Program Files" or I need to copy to "c:Program Files(x86)" directory ?

推荐答案

这正是 Microsoft 针对此类问题推荐的方法.如果您正在使用 COM,您可以制作 COM exe 服务器.对于 .NET 使用 WCF.在您的情况下 - 本机 C++,没有 COM - 内存映射文件或管道是一个不错的选择.

This is exactly the way Microsoft recommends for such kind of problems. If you are working with COM, you can make COM exe server. For .NET use WCF. In your case - native C++, no COM - memory-mapped file or pipe is a good choice.

关于安装目标文件夹 - 您需要使用用于构建安装包的工具进行测试.如果整个安装目标是 64 位,并且单个可执行文件是 32 位 - 该工具可能会显示有关此文件的警告.当文件被执行时,它是否在 Program Files 或 Program Files (x86) 或任何其他目录中都没有关系.

Regarding installation destination folder - you need to test this with the tool used to build installation packages. If the whole installation target is 64 bit, and single executable is 32 bit - the tool may show warning about this file. When the file is executed, it doesn't matter whether it is in Program Files or Program Files (x86), or any other directory.

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

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