Share via

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 | 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.

Developer technologies | .NET | .NET CLI
Developer technologies | C#
Developer technologies | 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.


Your answer

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