I have something like this:
if(GetFileAttributesW("C:\\Directory")!="INVALID_FILE_ATTRIBUTES") {...}
I get error: cannot convert ‘const char*’ to ‘const WCHAR*’ for argument ‘1’ to ‘DWORD GetFileAttributesW(const WCHAR*)’
How to convert const char* to const WCHAR*?
Don’t use
GetFileAttributesW, useGetFileAttributes. Add_Tto all const strings, and use_TCHAR*. AndINVALID_FILE_ATTRIBUESis definitely not a string…See Unicode Programming Summary.