C# to C++/MFC duplex mode - Concept

Markus Freitag 3,791 Reputation points
2021-06-30T18:58:17.22+00:00

Hello,
I have a static MFC C++ application, I cannot change it. (CLI is not possible)

I now need to pass data from a C# DLL in the C++ application and transfer it from the C++ to the C# DLL. What possibilities do I have to implement this successfully.

110695-concept.png

Can you show an example

SendDataOrderToCPP(string order, double price, int amount)  
  
ResponseDataOrderToCSharp(string order, double price, int amount)  

-----
Is there a possibility that the C# DLL sends an event and I can evaluate the value in the C++ app?

Is it possible that the C++ exe sends an event and I can evaluate the value in the C# DLL?

How would I have to create this?

//----
Background

I need to implement a WinForm in C# in which I can make inputs. I have to analyse these inputs in C++.

After the analysis, I have to send new data from C++ to C# to display the calculated values.

Or I need an additional DLL ?
110675-concept-2.png

Developer technologies C++
Developer technologies .NET .NET CLI
Developer technologies C#
{count} vote

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.