Problem in SHFileOperation
Hai,
I am using SHFileOperation() function to copy a file. It returns 0 if successfull. But when the source file does not exitst in the specified folder, the function is not returning a non zero value. Do any body know why?
# 3 Re: Problem in SHFileOperation
Originally posted by Siva Prakash
Yes it is returning 0
Hmmm...strange. I have to admit that I used the shell functions many times...at least never for file operations.
If you do not necessarely need to use this function you can use the API function 'CopyFile()' instead...
if(::CopyFile("c:\test.txt", // Source
"c:\temp\test.txt", // Destination
TRUE) == FALSE) // Flag whether function fails if file already exists
// Error -> call '::GetLastError()'