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

Markus Freitag 3,786 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

.NET CLI
.NET CLI
A cross-platform toolchain for developing, building, running, and publishing .NET applications.
322 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,199 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,519 questions
{count} vote