Solved

IShellLink::GetDescription() mostly returns empty on Win98

Posted on 1999-01-29
7
312 Views
Last Modified: 2013-12-03
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?
0
Comment
Question by:gnewman
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 15

Expert Comment

by:Tommy Hui
ID: 1419467
Which example are you referring to? Can you post a piece of the code?
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 1419468
Look at http://premium.microsoft.com/download/msdn/samples/3006.exe

IShellLink::GetDescrition is almost the same as IShallLink::Resolve.
0
 

Author Comment

by:gnewman
ID: 1419469
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.
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 23

Expert Comment

by:chensu
ID: 1419470
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.
0
 

Author Comment

by:gnewman
ID: 1419471
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.
0
 
LVL 23

Accepted Solution

by:
chensu earned 500 total points
ID: 1419472
So, the answer is

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.


Thank you.
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 1419473
I could have told you that. Why didn't I?
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This video discusses moving either the default database or any database to a new volume.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now