2

I come from a .net background and I am fairly new to developing in C++. I am well used to events in C# and raising events when something meaningful happens. What I'm not sure about it how to raise "an event" in C++ just when an event raised in C#.

I know how to create Managed COM from c# code and use in c++ code. Now I'm using a thread in c++ and check a variable that changes when c# trigger raised. but this solution is so bad...

How to make event x(C#) and event y(C++ MFC) peer to peer so that when event x raised, event y raising too?

  • I maybe able to help from the 'receiving' (MFC) end but I'm not sure how "raising an event" works in `C#`! Can you give a brief explanation, like does this send a message to the queue? – Adrian Mole Oct 28 '19 at 14:30
  • @Adrian Imagine C# is listening to USB for joystick and when joystick button pressed, a C# event raised. I want that related event in C++ MFC raising too. – Rashid Bagheri Oct 29 '19 at 07:26

1 Answers1

0

I Solved this challenge using "SendMessage" from C# to C++ or vice versa. see: https://www.codeproject.com/Articles/5307/Use-WM-COPYDATA-to-send-data-to-from-C-and-C-Windo