Link to home
Start Free TrialLog in
Avatar of gnewman
gnewman

asked on

IShellLink::GetDescription() mostly returns empty on Win98

When calling the IShellLink::GetDescription() function on .lnk files it sometimes returns the description string (they all have one) and other times returns an empty string.  I'm using the MSDN example code, so don't understand why.

What's happening and how do I get the description for all the shortcuts?
Avatar of Tommy Hui
Tommy Hui

Which example are you referring to? Can you post a piece of the code?
Look at http://premium.microsoft.com/download/msdn/samples/3006.exe

IShellLink::GetDescrition is almost the same as IShallLink::Resolve.
Avatar of gnewman

ASKER

The sample is the one you mentioned:

http://premium.microsoft.com/download/msdn/samples/3006.exe

and exhibits the problem (on Win98... I can't test on Win95 or NT).  I'm compiling with MSVC++ 4.2b

For example, the shortcut that RealPlayer puts in the Start menu returns a description
but the one that MS Office Word for Windows puts in the Start menu doesn't.  Just copy those shortcuts to the Sample folder and try them to see.
Not all shortcuts have a description. The application may not use IShellLink::SetDescription when creating a shortcut. The one that MS Office Word for Windows puts in the Start menu may not contain a description at all.
Avatar of gnewman

ASKER

Right you are!

Perhaps the documentation on shell links isn't clear enough for me.  It seems, upon closer examination, that the Microsoft documentation about shortcuts:

"A shortcut also has a description, which is a brief string that appears below the shell link icon. By default, the description consists of the words "Shortcut to" followed by the filename of the object. The user can edit the description string by selecting it and entering a new string."

is saying that the description is optional.  So what shows to the user is the filename if there is no Description.
ASKER CERTIFIED SOLUTION
Avatar of chensu
chensu
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I could have told you that. Why didn't I?