ProgJ 2016-02-25 08:25 采纳率: 50%
浏览 2162
已采纳

MFC FindFirstFile()的问题

程序运行没问题。
但是我有个疑问。。见图:
图片说明
我是用了FindFirstFile()和FindNextFile()遍历所有文件夹,上图是我读取的路径,里面有两个文件夹,一个默认,一个新建,但是我发现读取时FindFirstFile()读取的先是新建的文件夹名称,然后才是默认的文件夹,难道不应该先读取默认文件夹吗?

求解惑啊。。

  • 写回答

4条回答

  • Hungryof 2016-02-25 08:41
    关注

    https://msdn.microsoft.com/en-us/library/aa364418(VS.85).aspx 上面的Remark写了原因:
    The FindFirstFile function opens a search handle and returns information about the first file that the file system finds with a name that matches the specified pattern. This may or may not be the first file or directory that appears in a directory-listing application (such as the dir command) when given the same file name string pattern. This is because FindFirstFile does no sorting of the search results.

    FindFirstFile找到的文件和文件/文件夹显示的顺序不一定一样的,因为其对找到的结果不进行排序。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作