System::String to wstring

  • Thread starter Thread starter Tao
  • Start date Start date
T

Tao

hi.. group,

quick question: how to convert a managed data type system::string to
unmanaged wstring?

thanks.
 
Tao said:
quick question: how to convert a managed data type system::string to
unmanaged wstring?

Something like this:

#include <vcclr.h>

wchar_t __pin *pStr = PtrToStringChars(s);

should get you a pointer to the constituent characters.

Regards,
Will
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top