問題描述
我有一個應用程序 (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
- 等
這篇關于在同一系統上的兩個應用程序之間傳遞數據的首選方式是什么?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!