We have a monolithic MFC GUI app that is nearing the end of it's life in C++. We are planning to build new functionality in C# and pass data between each app.
Question is: What is the best approach for passing data between C++ and C#?
Notes:
Both ends will have a GUI front end and will probably only need to pass simple data like Id's and possibly have a mechanism where it indicates to the other app what process/functionality to use.
Eg One of the applications will be a CRM system in C# that when a row in a grid is double clicked would pass say the customerId and a message to open that customer in the Customer Form of the MFC app.
I have done a little bit of research, the options seem to be Windows Messaging, Memory Mapping, Named Pipes or something like Windows Sockets. At this stage we are leaning towards Named Pipes, but would really appreciate other advice or tips or other peoples experiences.
Personally I'd be thinking of using something like named pipes as they are easy to use from the C++ side and the System.IO.Pipes on the .NET side also.
It would also be the path of probably least resistance if you're planning to replace the other non .NET bits of the app over time.
Take your pick:
Why named pipes?
In .Net just use System.IO.Pipes.
In C++ use CreateNamedPipe and CreateFile.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With