However, I discovered what the problem was and it seems to be rather
strange and I was hoping someone could shed some light on it. If, in
Explorer, you select Hide MS-DOS extensions of registered file types,
IShellFolder::GetDisplayNameOf(SHGNO_NORMAL) returns the file name
without the extension. I was trying to open this file but since I had
no extension, I couldn't find the file. If that option is not turned
on, it returns the name with the extension.
I got around the problem by using SHGNO_FORPARSING (whatever it's
called) and then parsing the name out.
I thought this was very strange that an option in Explorer would
affect an API call like IShellFolder::GetDisplayNameOf.
Anyone have any ideas why MS would do something like this?
Jonathan Schafer
The "display name" of an item is "The name you should display to
the user". Programs are explicitly warned *not* to use the
display name for any other purpose. Specifically, it is not
necessarily a valid file name.
That's what "for parsing" is for. "For parsing" means "A program
is going to analyze (parse) the return value, so put it into a
form that uniquely identifies the item".
--
(Note that my return address is intentionally invalid in order
to foil electronic mailing list generation software.)