SHFileOperation is pissing me off - won't copy just 1 file
-
I'm using SHFileOperation to copy some files. If I set pFrom to a string with multiple, fully quailified filenames, seperated by a NULL with an additional NULL character at the end and pTo to a string with a fully qualified directory with the extra NULL character, it works fine. If my pFrom is only 1 fully quailified filename with the extra NULL character at the end, SHFileOperation instead makes a file with the pTo directory name of the size of the source file. Example... pFrom = c:\pictures\pic1.jpg, c:\pictures\pic2.jpg, etc... pTo = d:\jpg When I check the drive, I'll have d:\jpg folder containing all my files pic1.jpg, pic2.jpg, etc. If I'm only copying 1 file, pFrom = c:\pictures\pic1.jpg pTo = d:\jpg This time, I'll check the drive and I'll have file called jpg in d:\ with the size of pic1.jpg. I'm pulling my hair out trying to figure out whats going on. I've checked and I have the buffers set up correctly with additional NULLs at the ends etc. Anyone know what the problem is? Thanks, Steve
-
I'm using SHFileOperation to copy some files. If I set pFrom to a string with multiple, fully quailified filenames, seperated by a NULL with an additional NULL character at the end and pTo to a string with a fully qualified directory with the extra NULL character, it works fine. If my pFrom is only 1 fully quailified filename with the extra NULL character at the end, SHFileOperation instead makes a file with the pTo directory name of the size of the source file. Example... pFrom = c:\pictures\pic1.jpg, c:\pictures\pic2.jpg, etc... pTo = d:\jpg When I check the drive, I'll have d:\jpg folder containing all my files pic1.jpg, pic2.jpg, etc. If I'm only copying 1 file, pFrom = c:\pictures\pic1.jpg pTo = d:\jpg This time, I'll check the drive and I'll have file called jpg in d:\ with the size of pic1.jpg. I'm pulling my hair out trying to figure out whats going on. I've checked and I have the buffers set up correctly with additional NULLs at the ends etc. Anyone know what the problem is? Thanks, Steve
I don't think much of the title to your post!
-
I'm using SHFileOperation to copy some files. If I set pFrom to a string with multiple, fully quailified filenames, seperated by a NULL with an additional NULL character at the end and pTo to a string with a fully qualified directory with the extra NULL character, it works fine. If my pFrom is only 1 fully quailified filename with the extra NULL character at the end, SHFileOperation instead makes a file with the pTo directory name of the size of the source file. Example... pFrom = c:\pictures\pic1.jpg, c:\pictures\pic2.jpg, etc... pTo = d:\jpg When I check the drive, I'll have d:\jpg folder containing all my files pic1.jpg, pic2.jpg, etc. If I'm only copying 1 file, pFrom = c:\pictures\pic1.jpg pTo = d:\jpg This time, I'll check the drive and I'll have file called jpg in d:\ with the size of pic1.jpg. I'm pulling my hair out trying to figure out whats going on. I've checked and I have the buffers set up correctly with additional NULLs at the ends etc. Anyone know what the problem is? Thanks, Steve
Have you tried sticking a '\' at the back of pTo? eg. pTo = d:\jpg\.
-
Have you tried sticking a '\' at the back of pTo? eg. pTo = d:\jpg\.
-
I don't think much of the title to your post!
-
Thanks. I tried that and it and with the extra "\", it's not a vailid file name and generates an error.
Then I guess that your only alternative is to set pTo to d:\jpg\pic1.jpg