Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Visual Studio Favorites

0.00/5 (No votes)
16 Mar 2003 1  
Add shortcuts, favorites, and more to Visual Studio.

Intro

Menu shot

Visual Studio Favorites (VS Favs or VSF) is a Visual Studio 6.0 add-in that puts a shortcut and favorite access menu in the Visual Studio toolbar. This Favorites Menu is configurable, and can launch documents, programs, web shortcuts, folders, source code files, studio projects, and even browser databases - anything that Explorer can launch, this can too! All from within the comfort of your Visual Studio environment. You can configure the program to make your development life easier and quicker, with common projects and data files right at your fingertips.

In addition, VS Favs uses an XML file to store your configuration, making it very portable and easy to back up. This is extremely handy when you have to re-install Visual Studio for whatever reason, and your Tools menu has gotten deleted in the process. You can read the lovely documentation and download the installer from www.nopcode.com/visualfav at your leisure.

Please note this add-in will not work with Visual Studio 7 (a.k.a. .NET), it will only work with Visual Studio 6.0

How it works

The program is built around the updated XML 3.0 SDK that is part of the Microsoft SDK; if you do not have this, you will need to download it. This SDK is part of Internet Explorer 6.0, so most development systems already have the needed binaries - you will just need the headers and such. Since I have found the current SDK to cause problems with some of the older projects I have to maintain, the Visual Studio Favorites project has the path to the SDK includes put in it; if you install the SDK into anywhere other than C:\Program Files\Microsoft SDK, you will need to modify the project (Project Settings, C++, Preprocessor, Additional Include Paths). You can download the current Microsoft Platform SDK from Microsoft's site.

Creating add-ins for Visual Studio is not exactly a trivial matter. You need to juggle several files at once and understand how the COM objects are put together; this is why ATL is used and not MFC - ATL makes working with COM a lot easier, and since we're not using a lot of windows, MFC is complete overkill for the project.

The source code, more or less, is straight forward to understand. There is basically one main class, CConfigurationFile, which does all the handling of the XML file. Two other classes derive from that, CFavoritesMenu to display the items when the user clicks the toolbar button, and CConfigTree, which is used in the configuration dialog. The config tree class is where you might find most of the interesting bits of code, since this is where the dragging and dropping and other fun stuff takes place. Whenever the user clicks on the toolbar button, the XML file is loaded and the menu parsed.

If you're interested in how to put an add-in into Visual Studio, you'll want to look at the FavoritesAddIn, FavoritesAddInVCA, and Commands cpp and h files - these files contain the COM objects that Visual Studio uses. The FavoritesAddIn.idl of course defines these objects.

History

  • March 17th, 2003 - added support for icons.

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.

A list of licenses authors might use can be found here