error in the use of the function: SHFILEOPSTRUCT

I have a error in the use of the function: SHFILEOPSTRUCT

1
2
3
4
5
6
7
     wchar_t szDir[MAX_PATH];
     .........
     .........
     wchar_t * ptr;
     const wchar_t wch[ ]= L"\0";
     ptr = wcscat( szDir,wch  );//path
     shfileopstruct.pTo = ptr;


This error:
main.cpp:192:27: error: cannot convert 'wchar_t*' to 'LPCSTR {aka const char*}' in assignment
You are using wchar_t strings with a structure that is declared to use LPTSTR or similar data type. Incorrect. Either use TCHAR strings or use the Unicode version of the structure, which usually means to simply add a W at the end: SHFILEOPSTRUCTW.

Try it out.
Topic archived. No new replies allowed.