I see there are some other posts related to this issue. However, I want to ask if there is new elegant way to just exchange some messages between a C#.net application and a C++ application?
They are running on the same machine.
Thanks in advance.
I see there are some other posts related to this issue. However, I want to ask if there is new elegant way to just exchange some messages between a C#.net application and a C++ application?
They are running on the same machine.
Thanks in advance.
What you want is inter-process communication (IPC), which is language-agnostic by definition.
Typical solutions include:
You use different ones depending on your needs.
Here is information on windows-supported IPC methods: http://msdn.microsoft.com/en-us/library/windows/desktop/aa365574%28v=vs.85%29.aspx
Most of this functionality is exposed in C# through WCF, which is windows-specific of course. If you're using Mono, you're out of luck.
C++ doesn't define any IPC constructs in the language itself, so you will have to use platform-specific libraries regardless.
Search around for IPC examples in C# and C++ and you will get plenty of hits.
Here's a SO post to get you started: IPC Mechanisms in C# - Usage and Best Practices
I have always used sockets, that is the simplest way I can think of (not the most elegant though)
There are many mechanisms you can use to do this.
This article enumerates the common ways to accomplish interprocess communication on the windows platform. Most if not all are possible form both C# and C++ (though I would hate to see you use DDE from C#, though it has apparently been done).