Click here to Skip to main content
Click here to Skip to main content

Visual Studio 6.0 Boomark Manager Add-in

, 9 Jun 2006 CPOL
Rate this:
Please Sign up or sign in to vote.
Add-in to save and restore bookmarks to and from a .xml file and to activate and deactivate bookmarks.

Sample Image - BookMark.gif

Introduction

Visual Studio 6.0 provides a useful feature to set unnamed bookmarks to mark lines in a file. This is especially useful when going through a large source or log file.

Often times, I would like to disable some unnamed bookmarks, but enable them again later. For a large file and with lots of unnamed bookmarks, remembering the removed unnamed bookmark line numbers can be difficult.

The Edit Breakpoints feature allows breakpoints to be selectively set to inactive and then again to active later. However, this isn't available for unnamed bookmarks. Also, breakpoints in files are restored again if the files are reopened later. This feature also isn't available for unnamed bookmarks.

Another feature which I would like is to save the unnamed bookmarks of a file to a .xml file. I can then use this .xml file to restore the unnamed bookmarks at a later time.

This add-in provides the following features:

  • Save and restore unnamed bookmarks (active and inactive) to and from a .xml file.
  • Edit unnamed bookmarks (similar to the Edit Breakpoints feature provided by Visual Studio).
  • On reopening a closed document, all active and inactive unnamed bookmarks that were set for the file before it was closed are restored.

Using the add-in

Setting up the add-in

Copy the DLL file to a location in your local drive. In Visual Studio, in the Tools menu, select the Customize... menu item. In the Customize dialog that pops up, select the tab "Add-Ins and Macro Files". Use the Browse... button to browse to and select the DLL. "Manage Bookmarks" will appear in the list box. Check its checkbox and close the Customize dialog. The add-in toolbar will appear and the setup is done.

To remove the add-in, in the Customize dialog, uncheck the "Manage Bookmarks" entry in the list box.

The add-in toolbar

The add-in provides a toolbar with three buttons. They are Save bookmarks, Load bookmarks, and Edit bookmarks.

  • Save bookmarks prompts for the .xml file name to save all the active and inactive unnamed bookmarks for all open files in Visual Studio.
  • Load bookmarks prompts to select the .xml file from which the unnamed bookmarks will be restored.
  • Edit bookmarks brings up the Edit Bookmarks dialog. Uncheck or check the checkbox of an item in the list control of the Edit Bookmarks dialog to set an unnamed bookmark to inactive or active, respectively. Setting a bookmark to inactive (uncheck the checkbox in the Edit Bookmarks list) is similar to the feature of using the Edit Breakpoints dialog of Visual Studio to disable a breakpoint.

Restoring unnamed bookmarks on reopening files in Visual Studio

On closing a file which had active and inactive unnamed bookmarks, the bookmarks are remembered, and later reopening the same file again, restores the active and inactive bookmarks. The add-in automatically saves such bookmarks, when Visual Studio closes, to the file "VSBookmarks.xml" in the folder containing the MSDEV.exe (to be found in \Program Files\Microsoft Visual Studio\Common\MSDev98\Bin in your Visual Studio installed drive). To specify a file name and folder different from this, create a system environment variable VISUAL_STUDIO_BOOKMARKS_FILEPATH and set its value to the full path name of the .xml file to store the bookmarks, for example, C:\myBookmarks.xml.

Known issues and limitations

  1. The previous selection is not maintained after setting the bookmarks. However, the cursor position is restored to the previous line on which the cursor was present. The scroll position is not maintained, so you will find the cursor on the same line as before editing the bookmarks, but the scroll bar position of Visual Studio may be different.
  2. Restoring the unnamed bookmarks requires opening the files, so flickering occurs in the file window of Visual Studio since switching between files takes place.
  3. There is no provision to disable the bookmark saving to a file when Visual Studio closes, and to restore bookmarks on opening files or workspaces.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Inacio D'Silva
Web Developer
India India
Inacio D'Silva is from Goa, India. He's a BSc Computer Science graduate. He's mainly worked with MFC and C++.

Comments and Discussions

 
QuestionOnly works for VC6.0? PinmemberAlexWang26-May-10 16:38 
GeneralVB6 Pinmemberdandraka4-Apr-08 5:01 
GeneralWhy not Project path Pinmembervithalklrk5-Aug-06 8:15 
Questionwhich IDE's are supported? Pinmemberfeline_dracoform9-Jun-06 1:04 
AnswerRe: which IDE's are supported? PinmemberJörgen Sigvardsson9-Jun-06 8:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.141223.1 | Last Updated 9 Jun 2006
Article Copyright 2006 by Inacio D'Silva
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid