简体   繁体   English

C#和C ++应用程序之间的通信

[英]Communication between C# and C++ application

I have just start learning about WCF that can help me for the communication between two different platform application. 我刚刚开始学习WCF ,它可以帮助我在两个不同平台应用程序之间进行通信。 I have also created one simple application for the communication but both client and service are written in C#. 我还创建了一个用于通信的简单应用程序,但客户端和服务均使用C#编写。 I want to know how I can establish a C++ and C# application so that they communicate to each other. 我想知道如何建立C++C#应用程序,以便它们彼此通信。 Thanks in advance 提前致谢

this question seems very wide to me, the thing is since you are in windows, and the C# and C++ applicattions will be running simultaneously, you have to thing in the specific requeriments of you appliccation. 这个问题对我来说似乎很广泛,问题是由于您在Windows中,并且C#和C ++应用程序将同时运行,因此您必须根据应用程序的特定要求进行操作。

For example, I had a Server in C# wich recived some data, that had to be processed in C++ and then returned to the sender, so, since the C# and C++ process were in the same computer I used a File Mapping method, for example. 例如,我有一个使用C#的服务器,它获取了一些数据,这些数据必须先用C ++处理然后返回给发送方,因此,由于C#和C ++进程位于同一台计算机上,因此我使用了File Mapping方法。 。

Indepently of the language, what you have to make sure, is that the data you send, wen you recive it in the other process, that should be able to be understood. 无论您要确保哪种语言,都必须确保您发送的数据(在其他过程中接收到该数据)应该能够被理解。

Here is a link for more info in wnidows https://msdn.microsoft.com/en-us/library/windows/desktop/aa365574(v=vs.85).aspx 这是wnidows中更多信息的链接https://msdn.microsoft.com/zh-cn/library/windows/desktop/aa365574(v=vs.85).aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM