Creating an IShellItem instance for a non-existent file

假装没事ソ 提交于 2019-12-21 05:45:11

问题


How can I get an IShellItem object for a non-existent file (or directory)?

  • SHCreateItemFromParsingName and SHCreateItemFromRelativeName fail with 0x80070002 (file not found) and
  • ILCreateFromPath returns a NULL pidl.

First I thought it might be impossible, but for example IFileSaveDialog creates such an IShellItem for its result (if you specify a new file in the dialog).


回答1:


There is such a thing as a simple pidl and they can represent non-existent files. So I guess you want SHSimpleIDListFromPath and SHCreateItemFromIDList



来源:https://stackoverflow.com/questions/3835350/creating-an-ishellitem-instance-for-a-non-existent-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!