Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating an IShellItem instance for a non-existent file

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).

like image 536
gix Avatar asked Sep 30 '10 22:09

gix


1 Answers

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

like image 95
Anders Avatar answered Sep 30 '22 11:09

Anders