Introduction

ShortCut is a .NET class that allows you to create shortcuts to files as
well as resolve existing shortcuts. The class was coded in Managed C++ and
makes ample use of IJW. I have compiled the class as a Class Library under the
namespace ShortCutLib. Thus you can now use it from your C# and VB .NET
programs. Simply add a reference to the DLL. This is yet another example of how
Managed C++ eases the transition between managed and unmanaged code so easily.
It just works!

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

Share

About the Author

Nish Nishant is the Principal Software Architect/Consultant for Ganymede Software Solutions LLC, and is based out of Columbus, Ohio. He has over 17 years of software industry experience in various roles including Lead Software Architect, Principal Software Engineer, and Product Manager. Nish was a Microsoft Visual C++ MVP between 2002 and 2015.

Nish is an industry acknowledged expert in the Microsoft technology stack. He authored C++/CLI in Action for Manning Publications in 2005, and had previously co-authored Extending MFC Applications with the .NET Framework for Addison Wesley in 2003. In addition, he has over 140 published technology articles on CodeProject.com and another 250+ blog articles on his WordPress blog. Nish is vastly experienced in team management, mentoring teams, and directing all stages of software development.

Contact Nish : If you are interested in hiring Nish as a consultant, you can reach him via his google email id voidnish.

Comments and Discussions

Do you anybody know, how to get target exe in such lnk? For example, if you install MS Office 2007 target lnk are not pointed to word.exe etc. , but to windows installer\[some GUID]\[exe with icon], but how to resolve correct exe (exe, that is executed, when you doubleclick that LNK)?

I tried to use your code, by adding a reference to the DLL,
but i get an error message when compiling my project (called TestPictures)

The strange thing is that i get no error messages when adding the reference in my project. The DLL is located in My InetPub/wwwroot/bin directory. I also checked the properties of the DLL (ok for read and execute), but still that doesn't work

Access is denied: 'ShortCut'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Assembly Load Trace: The following information can be helpful to determine why the assembly 'ShortCut' could not be loaded.