Gat
Gat

Reputation: 115

Communication between two application( one in Qtc++ and another in C#)

I have the need to do communicate two application, one in Qt c++ with another in C#. The principle is the C# application launch the Qt application and the Qt return values to the C# application. What is the best way for do that?

Gat

P.S: I'm beginner in C++ and intermediate in C#

Upvotes: 0

Views: 932

Answers (1)

ken2k
ken2k

Reputation: 49013

You have several options here.

If the returned value can fit in an integer, then you definitely should use the ExitCode of your Qt process.

If the returned value is more complex, then you have to write a more complicated IPC system (Inter Process Communication). There are several options too:

  • write to a flat text file, and then read it in your C# application
  • add a message to a queue (MSMQ for instance), then read it in your C# application
  • host a webservice in the C# application, and call it from the Qt application (hosting a web service can easily be bone using WCF)
  • use named pipe
  • etc.

Upvotes: 2

Related Questions