I am trying to compile a project that was previous using /oldsyntax, but now with /clr.
std::string Jhc::Interop::stlString(System::String^ s)
{
std::string out;
const wchar_t __pin * str = PtrToStringChars(s);
int len = s->Length*4;
char *buf = new char[len];
memset(buf,len,0);
I have changed System::String *s
to System::String^ s
, but how do I covert the line with PtrToStringChars(s);
?
I have tried using pin_ptr
and interior_ptr
, but cannot make it work.