I am having a problem copying files from a directory using the Windows API SHFileOperation function.
I have a constant which is the root directory for where to copy the files to and then concatenate the username on the constant to form the full path of where to copy the files. EG.
ROOT_DIRECTORY = 'C:\My Directory';
sFromDir := ROOT_DIRECTORY +'\Users Directory'\';
When I then setup the SHFILEOPSTRUCT and use the SHFileOperation it will work fine for a couple times and then says 'Cannot copy file. File system error (1026).
However if i pass the pFrom part of the SHFILEOPSTRUCT as a literal everything works fine, even though it has exactly the same value????
Any help at all will be greatly appreciated!!