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); }
1.4m articles
1.4m replys
5 comments
57.0k users