I want to convert System::String ^ to LPCWSTR.
for
FindFirstFile(LPCWSTR,WIN32_FIND_DATA);
Please help.
I have found that
String^ str = "C:\\my.dll";
::LoadLibraryEx(LPCWSTR)Marshal::StringToHGlobalAnsi(str).ToPointer(), 0, flags);
does not work, returning code 87. Instead,
#include
CString s("C:\\my.dll");
::LoadLibraryEx((LPCWSTR)s, 0, flags);
has been working like a charm and seems to be the least verbose method.