Is there any method? My computer is AMD64.
::std::string str; BOOL loadU(const wchar_t* lpszPathName, int flag = 0);
When I used:
loadU(&str);
the VS2005 compiler says:
Error 7 error C2664:: cannot convert parameter 1 from 'std::string *__w64 ' to 'const wchar_t *'
How can I do it?
If you have a std::wstring object, you can call
c_str()on it to get awchar_t*:Since you are operating on a narrow string, however, you would first need to widen it. There are various options here; one is to use Windows’ built-in
MultiByteToWideCharroutine. That will give you anLPWSTR, which is equivalent towchar_t*.