G
Goran
Hi all!
I need to pass managed String from to C-style APIs. I see I can use
Marshal::StringToXXX functions. Is this the best we have? I understand
this will allocate a new string and create copy of my String. I want to
pass it as constant (LPCWSTR). I don't need allocation and copying,
just the pointer. Can I have it, pretty please?
In normal C++, we usually have conversion operator or a function to get
it from a string class (string::c_str() or CString:perator LPCTSTR or
_bstr_t:perator LPCTSTR etc). Is there a similar thing in .NET?
Thanks, Goran.
I need to pass managed String from to C-style APIs. I see I can use
Marshal::StringToXXX functions. Is this the best we have? I understand
this will allocate a new string and create copy of my String. I want to
pass it as constant (LPCWSTR). I don't need allocation and copying,
just the pointer. Can I have it, pretty please?
In normal C++, we usually have conversion operator or a function to get
it from a string class (string::c_str() or CString:perator LPCTSTR or
_bstr_t:perator LPCTSTR etc). Is there a similar thing in .NET?
Thanks, Goran.