
These 2 classes encapsulate the IShellLink
& IUniformResourceLocator COM interfaces as provided in Win32. These 2 interfaces
allow you to programmatically create the ubiquitous shortcuts including shortcuts to Urls.
The class provides an simple MFC wrapper over the SDK API.
The class also provides auto cleanup and is UNICODE enabled with build configurations
provided.
The enclosed
zip file contains the CShellLink & CUrlShellLink source
code and also includes a VC 6 workspace file to build a small demonstration app.
Copyright
- You are allowed to include the source code in
any product (commercial, shareware, freeware or otherwise) when your product
is released in binary form.
- You are allowed to modify the source code in
any way you want except you cannot modify the copyright details at the top
of each module.
- If you want to distribute source code with
your application, then you are only allowed to distribute versions released
by the author. This is to maintain a single distribution point for the
source code.
Updates
v1.0 (10 December 1998)
V1.1 (12th December 1998)
- Updated sample program to be called
ShelLink.
- Fixed a bug in CUrlShellLink::Save where
m_sTarget was not being set.
- Updated the trace comments in the code to
include the function from which the function fails.
- Demo program now displays some info about
what it is doing to the console window.
- Default build configuration is now
ASCII Debug instead of Unicode Debug.
V1.11 (4 April 2001)
- Updated copyright information
- Fixed 2 bugs in CURLLink::Save and CURLLink::Load.
Thanks to Martin MacRobert for spotting the problems
- Fixed COM interface leaks in
CUrlShellLink::~CUrlShellLink
V1.12 (26 January 2003)
- Fixed up #include of system headers so that they can be
included in the PCH
- Moved initialization of the GUIDs from the code to the
sample app.
- Fixed a copy and paste bug in the CShellLink::GetArguments()
method. Thanks to "Bin" for reporting this problem.
V1.13 (20 December 2006)
- Updated copyright details.
- Addition of a SHELLLINK_EXT_CLASS preprocessor macro to allow the class
to be more easily added to an extension DLL.
- Optimized CShellLinkInfo constructor
- Optimized CShellLink constructor
- Code now uses newer C++ style casts instead of C style casts.
- Optimized CUrlShellLink constructor
- Updated the sample app to clean compile on VC 2005
- CShellLinkInfo is no longer derived from CObject as it was not really
required
- Classes now use ATL's CComPtr for managing the various COM pointers
- Return values from functions now use HRESULT's instead of plain BOOL's
- The way the classes are now initialized have been reworked based on the
way the "FinalConstruct" mechanism works in ATL
- CUrlShellLink class is now no longer derived from CShellLink class
- Fixed a potential COM reference count bug in CShellLinkInfo::operator=
where we were making naked copies of a PIDL. Now the code makes a copy of
the PIDL so that each CShellLinkInfo class instance maintains its own
separate copy of its PIDL.
- Updated the documentation to use the same style as the web site.