Passing a string from C# to cpp with COM
Posted
by Yaron Naveh
on Stack Overflow
See other posts from Stack Overflow
or by Yaron Naveh
Published on 2010-04-24T16:37:55Z
Indexed on
2010/04/24
16:43 UTC
Read the original article
Hit count: 459
I have a C# COM server which is consumed by a cpp client.
One of the C# methods returns a string.
In cpp the returned string is represented in Unicode (UTF-16), at least according to the memory view.
- Is this always the case with COM strings?
- Is there a way to use UTF-8 instead?
- I saw some code where strings were passed between cpp and c# as byte arrays. Is there any benefit in this?
© Stack Overflow or respective owner