问题描述
我有一个应用程序 (A) 需要启动另一个应用程序 (B).我需要在应用程序之间传递数据.我可以想到两种方法.首先是打开一个套接字.第二种是通过dll共享数据.
I have an application (A) that needs to launch another application (B). I need to pass data between the applications. I can think of two approaches. The first is to open a socket. The second is to share data via a dll.
打开套接字方法很简单.
The opening socket approach is straight forward.
dll 方法我有一些问题吗?我可以将插件dll加载到B中.我想创建一个A可以用来将数据传递给B的dll.加载dll时,是否只加载了一个dll实例?如果是这样,这是否意味着可以在加载 dll 的应用程序之间共享数据?
The dll approach I have some questions? I can load plug-in dlls into B. I want to create a dll that A can use to pass data to B. When loading dlls, is only one instance of the dll loaded? If so, does this mean that data can be shared between applications that load the dll?
什么是更好的选择?
还有其他方法可以做到这一点吗?
Are there other ways of doing this?
推荐答案
您无法通过 DLL 有效地共享数据.其他方式:
You can't effectively share data via a DLL. Other ways:
- 磁盘文件
- 管道
- 共享内存
- 消息
- RPC
- CORBA
- COM
- 等
这篇关于在同一系统上的两个应用程序之间传递数据的首选方式是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!