Reputation: 2137
What would be the best way to pass information from a windows forms C# app to a MFC C++ app while they are running? I don't need to send much, just a small string.
Thanks, Jeff
Upvotes: 2
Views: 569
Reputation: 941347
Going down the list of IPC options:
Upvotes: 4
Reputation: 36438
MailSlot api is small and simple but requires P/Invoke to use from c# and can go outside your local machine so needs care. see my answer here
Named pipes may well be more robust but this is an alternate.
Upvotes: 0
Reputation: 15568
If the C++ app has a main window, take a look at using the SendMessage function (via P/Invoke) in the C# app to send a WM_COPYDATA message to the C++ app.
http://msdn.microsoft.com/en-us/library/ms649011%28VS.85%29.aspx
Upvotes: 0