Click here to Skip to main content
15,897,315 members
Articles / Programming Languages / C++

Sourcecode Control Switcher

Rate me:
Please Sign up or sign in to vote.
4.90/5 (15 votes)
8 Dec 2004CPOL2 min read 153.6K   2.7K   37  
A tool to switch the Sourcecode Control Provider which is used in a development environment.
SCCSwitcher Version 1.0 by S�nke Schau
SCCSwitcher@schau.org

Abstract
--------

This Tool offers an interface to choose which of all installed SCC providers ist used
as the default provider in SCC Integration.

Problem
-------

MS has defined an interface between SCC systems an application who want to interact with
these systems. The interface is exposed thru an dll supplied by the SCC provider.
More than one SCC can be installed at one site, but one of them should be specified as
the default SCC provider. 
Most tools - e. g. VCx - support only this default provider. Others like Kawa or VS
.NET let you choose the one to use.
As you can see, some tools in environments where people frequently switch between SCC 
providers are uncomfortable to use. You have to switch the SCC systems in the registry
by hand.

Solution
--------

Take this little program -
It has two purposes:
1. give a visual clue which SCC provider is currently active
2. provide an interface to change between SCC providers
3. start the UI of the current provider

Deployment
----------

Copy the program to a location you like.
Start it, and it will add itself to the taskbar.
Click with the right mouse button to display the menu.
Choose to the provider you like to use.
Remember: the change will not be reflected in running apps. You must restart them
to get the new setting.
Choose "Start SCC Interface" or doubleclick with the left button to start the
userinterface of the "current" provider.
Click with the left button to display a menu with all SCC Providers. Choose the
one you'ld like to start.
Maybe add it to the "autostart" group via menu option.

UI Enhancement
--------------

To provide an icon for each SCC provider create a registry value in the Provider section
pointed to by the value <Provider Name> in the key

HKEY_LOCAL_MACHINE\Software\Microsoft\SourceCodeControlProvider\InstalledSCCProviders

The value must be Text and named "IconDll". It must contain the complete path to the
Image - Exe or Dll - which contains the Icon. As an option a Iconindex, seperated from
the path by an ',' can be supplied. Otherwise 1 will be used as an default index.
You can find the correct index by opening the Image in an Resource Editor.

For Example
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SourceSafe]
"IconDll"="C:\Programme\Microsoft Visual Studio\Vss\win32\Ssexp.exe,12"
will do in my Visual Sourcesafe installation.

Problems
--------

You should have write access to 
HKEY_LOCAL_MACHINE\Software\Microsoft\SourceCodeControlProvider otherwise the program will
not start.
When you have no write access to 
HKEY_CURRENT_USER\Software\Windows\CurrentVersion\Run
the Autostartoption is disabled.

In Terminalserver and XP with the Userswitching Feature you can start SCCSwitcher
multiple times. It will show up in each started session. When you switch to another
provider, the change is only reflected in the current session. To automatically
switch the other session too, we have to monitor the relevant registry section.
But who will really need such a feature?

The program was written and tested on NT 4.0 SP6, W2K an XP Professional.

Building
--------
There are four configurations:
Debug                        -> Non Unicode - normal libs - Debugoptions                   -> Exe=169K
Release                      -> Non Unicode - normal libs - Releaseoptions                 -> Exe=36K
Release Libtiny              -> Non Unicode - Libctiny    - Releaseoptions + /Opt:NOWIN98  -> Exe=16K
Release Unicode              -> Unicode     - normal libs - Releaseoptions                 -> Exe=25K
Release Windows 2000 Libtiny -> Non Unicode - Libctiny    - Releaseoptions + /Opt:NOWIN98
Release Windows 2000 Unicode -> Unicode     - normal libs - Releaseoptions                 -> Exe=39K

Libctiny is a MS Runtime replacement with a small memory footprint.
You can get it here: http://msdn.microsoft.com/msdnmag/issues/01/01/code/hood0101.exe
For an explanation search http://msdn.microsoft.com/msdnmag

Revision History
----------------

1.0.0.3 - 31. January 2001
Added popupmenu on left click to start a selected SCC-UI

1.0.0.2 - 24. January 2001
Added option to start UI
Added option to start program at shellstart
Introduced several build configurations

1.0.0.1 - 17. January 2001
Initial release.

Good luck!
Send comments, bug report etc. to sccswitcher@schau.org

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

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


Written By
Software Developer (Senior)
Germany Germany
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions