問題描述
我有一個(gè)應(yīng)用程序 (A) 需要啟動另一個(gè)應(yīng)用程序 (B).我需要在應(yīng)用程序之間傳遞數(shù)據(jù).我可以想到兩種方法.首先是打開一個(gè)套接字.第二種是通過dll共享數(shù)據(jù).
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中.我想創(chuàng)建一個(gè)A可以用來將數(shù)據(jù)傳遞給B的dll.加載dll時(shí),是否只加載了一個(gè)dll實(shí)例?如果是這樣,這是否意味著可以在加載 dll 的應(yīng)用程序之間共享數(shù)據(jù)?
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?
什么是更好的選擇?
還有其他方法可以做到這一點(diǎn)嗎?
Are there other ways of doing this?
推薦答案
您無法通過 DLL 有效地共享數(shù)據(jù).其他方式:
You can't effectively share data via a DLL. Other ways:
- 磁盤文件
- 管道
- 共享內(nèi)存
- 消息
- RPC
- CORBA
- COM
- 等
這篇關(guān)于在同一系統(tǒng)上的兩個(gè)應(yīng)用程序之間傳遞數(shù)據(jù)的首選方式是什么?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!