Solved

IShellLink::GetDescription() mostly returns empty on Win98

Posted on 1999-01-29
7
318 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

751 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