I want to convert System::String ^ to LPCWSTR.
System::String ^
LPCWSTR
for
FindFirstFile(LPCWSTR,WIN32_FIND_DATA);
Please help.
The easiest way to do this in C++/CLI is to use pin_ptr:
pin_ptr
#include <vcclr.h> void CallFindFirstFile(System::String^ s) { WIN32_FIND_DATA data; pin_ptr<const wchar_t> wname = PtrToStringChars(s); FindFirstFile(wname, &data); }
2.1m questions
2.1m answers
60 comments
57.0k users