I can not understand the behavior of the CopyFile function.
I wrote small program. In the program I want to create a new project.
I click on the New and custom NewDlg appears. In the location I type
E:\Projects\NewProject1 \( note that there is the space after NewProject1)
I get this string and create dir with the space at the end by using _wmkdir function. Then I want to copy some files from some location to E:\Projects\NewProject1 \(note that there is the space at the end). CopyFiles fails to do that. I checked the destination string it is still has the space and it looks like this E:\Projects\NewProject1 \file.txt.
I was curios and started cmd.exe. I tried to change dir to the newly created folder
E:\Projects> cd NewProject1 (with space at the end and without) and I’ve got the error stating “can not find specified location”
Then I change the function _wmkdir to CreateDirectoryw in my program and did exactly the same as explained above. CopyFiles failed again but in the dos prompt I was able to change directory to the newly created dir when I was typing space at the end.
Then I used mkdir to create directory. CopyFiles failed again but in the dos prompt I was able to change directory to the newly created when I typed the name of the dir with and without space at the end.
If I type E:\Projects\New Project1\ (with space anywhere but at the end) Everything works fine.
I am using winXp and VS 6.0.
I will appreciate any explanation.
Thanks.
I wrote small program. In the program I want to create a new project.
I click on the New and custom NewDlg appears. In the location I type
E:\Projects\NewProject1 \( note that there is the space after NewProject1)
I get this string and create dir with the space at the end by using _wmkdir function. Then I want to copy some files from some location to E:\Projects\NewProject1 \(note that there is the space at the end). CopyFiles fails to do that. I checked the destination string it is still has the space and it looks like this E:\Projects\NewProject1 \file.txt.
I was curios and started cmd.exe. I tried to change dir to the newly created folder
E:\Projects> cd NewProject1 (with space at the end and without) and I’ve got the error stating “can not find specified location”
Then I change the function _wmkdir to CreateDirectoryw in my program and did exactly the same as explained above. CopyFiles failed again but in the dos prompt I was able to change directory to the newly created dir when I was typing space at the end.
Then I used mkdir to create directory. CopyFiles failed again but in the dos prompt I was able to change directory to the newly created when I typed the name of the dir with and without space at the end.
If I type E:\Projects\New Project1\ (with space anywhere but at the end) Everything works fine.
I am using winXp and VS 6.0.
I will appreciate any explanation.
Thanks.