开发者社区> 问答> 正文

SHFileOperation: ERROR_FILE_NOT_FOUND 和 ERROR_PATH_NOT_FOUND 的区别

我在看 SHFileOperation 用法 的时候,在 Winerror.h 的说明 里,看到了这段话

ERROR_FILE_NOT_FOUND

2 (0x2)

The system cannot find the file specified.

ERROR_PATH_NOT_FOUND

3 (0x3)

The system cannot find the path specified.
我自己写了一段测试代码:

SHFILEOPSTRUCTA shfo;
shfo.wFunc = FO_DELETE;
shfo.pFrom = "no_such_folder\test.txt0"
ret =SHFileOperation(&shfo);
返回值却是 DE_INVALIDFILES(0x7c)

请问,ERROR_FILE_NOT_FOUND和ERROR_PATH_NOT_FOUND 区别在哪里?怎么才能让返回值为 ERROR_PATH_NOT_FOUND ?

谢谢您的解答

展开
收起
a123456678 2016-06-06 11:37:42 2878 0
1 条回答
写回答
取消 提交回答
  • `
    "Z:test.txt"
    `

    2019-07-17 19:28:04
    赞同 展开评论 打赏
问答地址:
问答排行榜
最热
最新

相关电子书

更多
How to Build a Successful Data 立即下载
Why you should care about data layout in the file system 立即下载
OPEN SOURCE IN A DATA-DRIVEN WORLD 立即下载