Link to home
Start Free TrialLog in
Avatar of efryevt
efryevt

asked on

How to pass strings from C++ to C#

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?  
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of efryevt
efryevt

ASKER

I would not of thought to do it this way, but it works like a charm...once I got it to compile in my project.  Thanks.