Visual Studio Source Code Control Provider Switcher

Environment: VC++ 6.0 SP4, Win95/98/NT/Me/2K/XP


One of the many aggravations of Visual Studio is the inflexibility in changing the source code control (SCC) provider. After researching the problem, I found that all SCC provider information is stored in the Registry under HKEY_LOCAL_MACHINE\SOFTWARE\SourceCodeControlProvider. If you open the Registry and go to this key location, you will, more or less, find the keys self-explanatory. My first attempt to work with this was to create a batch file to change the Registry key for me. I then decided to learn how to create add-ins and this is my first add-in project. Because I'm including the source code in this article, I decided against showing code snippets; they aren't very necessary. This really is a very simple add-in that shouldn't be all that difficult to follow. Hope it meets everyone's approval.

To begin, open Visual C++ and create a new Workspace using the DevStudio Add-in Wizard. Other articles might say that using a wizard is bad, which I tend to agree with, but for a first-time user, that's all one usually has or knows. Give your project a name and click OK. Fill in the add-in name and add a description. This should create various files in your project, among which is Commands.cpp.

Open up Commands.cpp and go to STDMETHODIMP CCommands::YourProjectNameCommandMethod(). This is where your code gets called. Next, I created a dialog that accessed the Registry, and called it using dlg.DoModal() from the previous CCommands' function. Once you're done setting it up, building it should create an add-in DLL that Visual Studio can use.

To use the DLL from within Visual Studio, go to Tools, Customize, or right-click on the menu area and select Customize. Click on the "Add-ins and Macro Files" tab and select browse to search for your add-in. Remember to change the file type at the bottom of the browse dialog from "Macro Files" to "Add-ins;" otherwise, you won't see it. Once selected, click Open, then Close, to see a new toolbar appear.

Fixes to Common Problems Found

After selecting your add-in, the name should appear in the "Add-ins and Macro files" tab in the Customize dialog. If you highlight your add-in, the description that you added in the wizard appears on the right-hand side. This can be changed in the String Table in the resources window. To change the add-in string that appears in the left hand side, search for DECLARE_REGISTRY in DSAddin.h and change the second argument to fix it.

To change the toolbar icon, modify IDR_TOOLBAR_LARGE and IDR_TOOLBAR_MEDIUM in your add-in workspace.

Limitations in this Add-In

For the life of me, I can't figure out how to change the toolbar name programmatically. Visual Studio tends to name all new toolbars as Toolbar#. This seemed to be the most difficult thing to change. To change it on startup, open up the Customize dialog and click on the "Toolbars" tab. Change the name of the toolbar to whatever you want and click OK.

Recompiling the project without unselecting the add-in and closing Visual Studio. Will have to look into this one some more.

Changing the SCC Provider without Having to Close Visual Studio

Once I find more documentation on what the registry values under the Options key are, I will replace them with something more readable.

Building my project under DEBUG mode will probably fail. The problem is due to a hyperlink class that I'm using in my About dialog.


An improved hyperlink control, by Giancarlo Iovino.

All questions, comments, or feedback are always appreciated.


Download Add-in - 27 Kb
Download Source - 47 Kb


  • Dead links ?

    Posted by jpcre on 12/15/2005 12:06pm

    Cannot download Add-in or Source. Open CodeGuru site map instead.

  • Another SCC switcher option

    Posted by cbecker on 10/19/2004 02:24pm

    Give this one a try: TraySource Runs in the tray and works with all SCC providers

  • missed a file in the zip files.

    Posted by jackliusr on 08/29/2004 11:09pm

    SCCProvider.def is missed in the source zip file

  • Documentation

    Posted by Legacy on 10/04/2002 12:00am

    Originally posted by: Maarten

    Hi Bassam,

    the add-in looks really handy, but I was wondering if you could add some documentation.
    At the moment, what I would like to know is:
    - what do the numbers mean in the options window. What if you leave a blank field? Can I bypass these extra source control options? (I would like to use my regular Visual Studio settings)
    - if I choose to remove source control integration and reconnect to source control later, will my source control bindings be restored or will I need to add my projects again to source control?

    Thanks in advance,

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Enterprises are increasingly looking to platform as a service (PaaS) to lower their costs and speed their time to market for new applications. Developing, deploying, and managing applications in the cloud eliminates the time and expense of managing a physical infrastructure to support them. PaaS offerings must deliver additional long-term benefits, such as a lower total cost of ownership (TCO), rapid scalability, and ease of integration, all while providing robust security and availability. This report …

  • Anthony Christie, the Chief Marketing Officer for Level Communications, is responsible for customer experience, worldwide marketing and product management. In this informative asset, he shares his insights into why a private network connection to cloud-bases applications is the right decision for your enterprise. Download now to find out more.

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date