N
nicolas.hilaire
hi all,
i'm using this code to convert a String ^ in char *
String ^str = "string .net";
IntPtr p =
System::Runtime::InteropServices::Marshal::StringToHGlobalAnsi(str);
LPCSTR str2 = reinterpret_cast<LPCSTR>(static_cast<void *>(p));
System::Runtime::InteropServices::Marshal::FreeHGlobal(p);
I would like to make safe code, so i would like to use safe_cast
instead of reinterpret_cast or static_cast.
I tryed, but i can't achieve making something to work.
Do you have an idea ?
Thanks in advance for your help
Nicolas H.
i'm using this code to convert a String ^ in char *
String ^str = "string .net";
IntPtr p =
System::Runtime::InteropServices::Marshal::StringToHGlobalAnsi(str);
LPCSTR str2 = reinterpret_cast<LPCSTR>(static_cast<void *>(p));
System::Runtime::InteropServices::Marshal::FreeHGlobal(p);
I would like to make safe code, so i would like to use safe_cast
instead of reinterpret_cast or static_cast.
I tryed, but i can't achieve making something to work.
Do you have an idea ?
Thanks in advance for your help
Nicolas H.