5,666,979 members and growing! (16,705 online)
Email Password   helpLost your password?
General Programming » Macros and Add-ins » General     Intermediate

Visual Studio 6.0 Boomark Manager Add-in

By Inacio D'Silva

Add-in to save and restore bookmarks to and from a .xml file and to activate and deactivate bookmarks.
VC6, C++Windows, WinXP, Visual Studio, Dev

Posted: 9 Jun 2006
Updated: 9 Jun 2006
Views: 11,553
Bookmarked: 11 times
Announcements
Loading...



Search    
Advanced Search
Sitemap
10 votes for this Article.
Popularity: 3.92 Rating: 3.92 out of 5
0 votes, 0.0%
1
2 votes, 20.0%
2
0 votes, 0.0%
3
3 votes, 30.0%
4
5 votes, 50.0%
5
Note: This is an unedited contribution. If this article is inappropriate, needs attention or copies someone else's work without reference then please Report This Article

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 at 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 & then again set 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.
1. Save and restore unnamed bookmarks (active and inactive) to and from a .xml file.
2. Edit unnamed bookmarks (similar to Edit breakpoints feature provided by Visual Studio).
3. On reopening a closed document, any 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 & select the dll. "Manage Bookmarks" will appear in the list box. Check it's checkbox and close the Customize dialog. The add-in toolbar will appear & 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 3 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 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 & folder different from this, create a system environment variable VISUAL_STUDIO_BOOKMARKS_FILEPATH and set it's 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 file when Visual Studio closes and restore bookmarks on opening files or workspace.

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

About the Author

Inacio D'Silva


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

Other popular Macros and Add-ins articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 4 of 4 (Total in Forum: 4) (Refresh)FirstPrevNext
GeneralVB6memberdandraka5:01 4 Apr '08  
GeneralWhy not Project pathmembervithalklrk8:15 5 Aug '06  
Generalwhich IDE's are supported?memberfeline_dracoform1:04 9 Jun '06  
GeneralRe: which IDE's are supported?memberJörgen Sigvardsson8:13 9 Jun '06  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 9 Jun 2006
Editor:
Copyright 2006 by Inacio D'Silva
Everything else Copyright © CodeProject, 1999-2008
Web20 | Advertise on the Code Project