I'm using the common file dialog with FOS_PICKFOLDERS
to let the user pick a location to save files. If the user selects a library, e.g. Library\Documents
then my current code fails at the point where I call IShellItem::GetDisplayName
to extract a file system name. If the item were a file then this would succeed and the library's default save location would be used.
What I would like to do is to detect that the shell item is a library, then obtain an IShellLibrary
interface, and then query it to find the default save location. Then I would save my files there.
What is the correct way to detect that an IShellItem
refers to a Library?