[Mono-list] Marshaling string on Windows returns Garbage??

efontana eric at fontanas.net
Tue Mar 13 11:48:44 UTC 2012


My code (on Windows) uses CoTaskMemAlloc to allocate the string and strcpy 
it into the buffer.

However, instead of returning "test" it returns eight question marks
"????????" usually when
I see things like this its a ANSI / Unicode problem.  My C++ host app is not
using Unicode.
I tried using the CharSet=Ansi but it made no difference, on Linux I'm using
strdup and the code
works perfectly, any pointers?

http://pastebin.com/vRBuL6A9

--
View this message in context: http://mono.1490590.n4.nabble.com/Marshaling-string-on-Windows-returns-Garbage-tp4468863p4468863.html
Sent from the Mono - General mailing list archive at Nabble.com.


More information about the Mono-list mailing list