I am trying to use SHFileOperation()
to copy a folder, but get this error:
a value of type "const char *" cannot be assigned to an entity of type "PCZZWSTR"
for both s.pTo
and s.pFrom
.
The code I'm using is:
SHFILEOPSTRUCT s = { 0 };
s.hwnd = hWnd;
s.wFunc = FO_COPY;
s.fFlags = FOF_SILENT;
s.pTo = "C:\\Users\\styler\\Desktop\\Folder1\0";
s.pFrom = "C:\\Users\\styler\\Desktop\\Software\\Folder2\\Folder3\\*\0";
SHFileOperation(&s);
What am I doing wrong in s.pTo
and s.pFrom
? I am setting those equal to the target folder and the source folder, but why is this not working?