3
Answers

BSTR to String backwards marshaling

Opariti

Opariti

16y
11.5k
1

Hi there!

I have a COM server at the lowest level of C++, closer to C. I have reached to connect it with a DLL in C#, sending strings from C# and getting BSTRs in COM. When I try to send backwords, i.e. BSTRs from C++ I'm having strange characters got in C#. Since the .net marshalling goes fine from C# to COM, what's the corresponding conversion method (or attribute) for "what I receive in C# from COM" to transform in the right string in C#? Thanks!

Answers (3)