How to pass strings from C++ to C#
Posted on 2011-02-28
Here is what I am trying to do:
I have a C# application that contains an unmanaged C++ project. The C++ project is responsble for collecting messages from a "server" via ethernet then firing an event so that the C# knows that there is a new message. Then the C# reads the message.
I have the event working, but I am seeing issues with getting the string to the C# code. In the C++ dll the message is available as a wstring. What is the best way to do this?