VC++ convert String^ to LPCTSTR:
LPCTSTR anLPCTSTRvariable = (LPCTSTR)(System::Runtime::InteropServices::Marshal::StringToHGlobalUni(aStringVariable)).ToPointer();
VC++ convert LPCTSTR to String^:
String ^aStringVariable = System::Runtime::InteropServices::Marshal::PtrToStringUni((IntPtr)(void*)(LPCTSTR)anLPCTSTRvariable);
That's all folks!
No comments:
Post a Comment