gpt4 book ai didi

c++ - CDocument::SetPathName 在 WinXp 和 Windows 7 中的行为不同

转载 作者:行者123 更新时间:2023-11-30 03:06:57 26 4
gpt4 key购买 nike

当我在 Windows XP 中使用 'eererr.hpr' 调用 CDocument::SetPathName 时,它会用值 'C:\Program Files 更新成员变量 m_strPathName\ICEHost\Projects\eererr.hpr'

当我在 Windows 7 中执行相同的方法时,它将 m_strPathName 更新为 'C:\Program Files\ICEHost\eererr.hpr' Projects 此路径中缺少目录

在 WinXp 和 Windows 7 中造成这种差异的原因是什么?CDocument::SetPathName 根据什么信息更新 m_strPathName?如何使行为相同?

最佳答案

SetPathName() 调用 GetFullPathName(),它“将当前驱动器和目录的名称与指定的文件名合并”。所以区别可能在于如何获取当前目录。

它记录了 CFileDialog 如何在不同的操作系统上选择不同的初始目录(检查下面的 lpstrInitialDir link ).也许与此有关。

关于c++ - CDocument::SetPathName 在 WinXp 和 Windows 7 中的行为不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6151563/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com