在同一系统上的两个应用程序之间传递数据的首选方式是什么?

2023-01-20C/C++开发问题
3

本文介绍了在同一系统上的两个应用程序之间传递数据的首选方式是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我有一个应用程序 (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

这篇关于在同一系统上的两个应用程序之间传递数据的首选方式是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

无法访问 C++ std::set 中对象的非常量成员函数
Unable to access non-const member functions of objects in C++ std::set(无法访问 C++ std::set 中对象的非常量成员函数)...
2024-08-14 C/C++开发问题
17

从 lambda 构造 std::function 参数
Constructing std::function argument from lambda(从 lambda 构造 std::function 参数)...
2024-08-14 C/C++开发问题
25

STL BigInt 类实现
STL BigInt class implementation(STL BigInt 类实现)...
2024-08-14 C/C++开发问题
3

使用 std::atomic 和 std::condition_variable 同步不可靠
Sync is unreliable using std::atomic and std::condition_variable(使用 std::atomic 和 std::condition_variable 同步不可靠)...
2024-08-14 C/C++开发问题
17

在 STL 中将列表元素移动到末尾
Move list element to the end in STL(在 STL 中将列表元素移动到末尾)...
2024-08-14 C/C++开发问题
9

为什么禁止对存储在 STL 容器中的类重载 operator&()?
Why is overloading operatoramp;() prohibited for classes stored in STL containers?(为什么禁止对存储在 STL 容器中的类重载 operatoramp;()?)...
2024-08-14 C/C++开发问题
6