好像文件夹路径最后加不加那个斜杠会影响结果?之前试的时候从source往dest中复制的话怎么折腾都成功,现在往dest下的aaa文件夹里放感觉有时候就会失败,nResult返回值有时候是123,有时候是87,有墙,还查不到更多的信息,有时候复制成功但是又吧source本身都复制过去了,好混乱啊,到底怎么正确使用呢? [解决办法] http://msdn.microsoft.com/en-us/library/windows/desktop/bb775771(v=vs.85).aspx 微软更推荐用IFileOperation [解决办法] Important You must ensure that the source and destination paths are double-null terminated. A normal string ends in just a single null character. If you pass that value in either the source or destination members, the function will not realize when it has reached the end of the string and will continue to read on in memory until it comes to a random double null value. This can at least lead to a buffer overrun, and possibly the unintended deletion of unrelated data.
如果非要说LZ有啥问题,你的源路径和目标路径都必须是双null结尾,因为这个API支持多个路径放一起,用null隔开,所以双null才是标志路径结束。 example
Important You must ensure that the source and destination paths are double-null terminated. A normal string ends in just a single null character. If you pass that value in either the source or destination members, the function will not realize when it has reached the end of the string and will continue to read on in memory until it comes to a random double null value. This can at least lead to a buffer overrun, and possibly the unintended deletion of unrelated data.
如果非要说LZ有啥问题,你的源路径和目标路径都必须是双null结尾,因为这个API支持多个路径放一起,用null隔开,所以双null才是标志路径结束。 example