近期在开发中发现SHFileOperation函数在Win7中的使用对路径的格式有更加严格的限制,而在Win8中则直接报错,返回值为8,错误原因不详。
在MSDN中发现如下说明:
Note As of Windows Vista, the use of the
IFileOperation interface is recommended over this function.
由于IFileOperation接口的使用过于繁琐,暂时以CopyFile函数代替,在Vista以后的版本中尽量不再使用SHFileOperation函数。
本文探讨了SHFileOperation函数在Win7和Win8版本中对路径格式的严格限制差异,并提出了使用IFileOperation接口作为替代方案。在Vista以后的版本中,建议尽量避免使用SHFileOperation函数。
6947

被折叠的 条评论
为什么被折叠?



