[.net] String^ to std::wstring
I have a managed C++/CLI class that uses some native code in the member functions. I need to convert a String^ to std::wstring. What is the easiest way?
Use PtrToStringChars in vcclr.h to get a pin_ptr<const wchar_t>, and construct a wstring from that pointer.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement