Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

URL Shortcuts in C++ MFC

Posted on 1998-07-15
4
Medium Priority
?
806 Views
Last Modified: 2012-05-04
I've figured out how to process IShellLink objects in MFC, but I also want to be able to handle .url files and special shortcuts like network neighbourhood and links to network shares. How do I do this?
0
Comment
Question by:williamjm
  • 2
4 Comments
 

Expert Comment

by:dst
ID: 1167883
First of all: MFC SUCKS!!
Secondly: Maybe you can use ShellExecute()
0
 
LVL 23

Accepted Solution

by:
chensu earned 400 total points
ID: 1167884
A URL shortcut is a plain text file, which looks like the following.

[InternetShortcut]
URL=http://www.experts-exchange.com/topics/comp/lang/cplusplus/U.williamjm

To create a shell link to an object that is not a file, use IShellLink::SetIDList instead of IShellLink::SetPath. You may get the PIDL by using the SHGetSpecialFolderLocation function.
0
 

Author Comment

by:williamjm
ID: 1167885
Great stuff...I should have thought of dumping the file to check its format.
Thanks.  I still have to look into how network neighbourhood works; is there anywhere I can find out about the specific ids? Or do I just experiment?
0
 
LVL 23

Expert Comment

by:chensu
ID: 1167886
As I mentioned, use the SHGetSpecialFolderLocation function with CSIDL_NETWORK to get the PIDL for Network Neighborhood.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

877 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