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

How to work with VSS through the VC++ 6.0 development environment

, 6 Aug 2003
Rate this:
Please Sign up or sign in to vote.
Integrating Visual SourceSafe with Visual Studio

Introduction

Visual SourceSafe® has become every Windows® developer’s companion as regards maintaining his or her code as well as, a means to keep track of the various versions of his or her development. This makes his or her life a lot simpler, and avoids the unnecessary usage of his or her disk space.

I would like to share with you folks a unique way of using this invaluable tool through your favorite development environment. Yes, it is very much your own Visual C++ Version 6.0 IDE. So, just tie up those walking shoes, and follow me.

Configuring VSS from the VC++ environment

Start the environment by invoking msdev.exe from the Run prompt. After the environment is open and ready,

  1. Select Tools->Options.
  2. Select the Source Control tab from the Options dialog.

    Fig. 1 Options Dialog

  3. Tick the checkboxes as shown in figure 1 above. Enter a login ID in the edit box Login ID.
  4. You need to consult your VSS Administrator, before using the "Advanced" options through the "Advanced" button.
  5. Click OK to accept the settings.

After you make the above settings the VC++ IDE will automatically prompt you to save your newly created workspace in VSS each time you create one.

How to add a new workspace to VSS

After you create a new workspace using the AppWizard, you will get a message as shown below:

Fig. 2 Visual C++ message, to store a project in VSS.

Click the ‘Yes’ button, to store the newly created workspace in VSS. You will see the Visual SourceSafe Login dialog, which will prompt you for the Login ID, Password and the VSS Database path.

Fig. 3 The VSS Login dialog.

Please enter your Login ID (the one you had entered while configuring VSS). You need to consult your VSS Administrator for your Password and VSS Database entries. After you have done so, click on the Browse button to select the path of your VSS Database. You will be able to do so using the dialog shown below.

Fig.4 Dialog to select VSS database.

Click the browse button to select the path of the database file srcsafe.ini using the Find Database dialog.

Fig. 5 Select your VSS Database path using Find Database dialog

After you click Open button, you will be asked to confirm this path as shown below.

Fig. 6 Confirm the path of VSS database.

Select OK to confirm, or Cancel to recheck the VSS database path. After you have confirmed the path. You will see this path in the Available databases: list. Click the Open button to open the VSS database. You will be again prompted to confirm your LoginID, Password and Database path by the VSS Login dialog. Click the OK button to accept the information or Cancel to exit.

Fig.7 Your database path is added to the Available databases list

After you click OK, you will be prompted to create a new Project folder under your VSS database path, through the Add to SourceSafe Project dialog as shown in Fig. 8 below.

Fig. 8 Add your project to the VSS database tree from here.

Click OK to accept the default Project name as the name of the folder where the project will be saved under your VSS database tree. After you have done so, you will be prompted by VSS to confirm the creation of this folder, as it does not exist as yet, under your database tree. This is done as shown in Fig. 9 below.

Fig. 9 Confirm creation of the new folder in your database.

After you click ‘Yes’ button to accept the creation of the folder you will be allowed to select the files in the project, which you want to store in VSS through the Add to Source Control dialog.

Fig. 10 The list of project files which will be stored in VSS.

By default, VSS selects all your files for storing; you may remove the ticks from any files which you do not want to store in VSS. You may add your comments in the Comment edit box.

The selected files are Checked Out by default, to allow modifications. You need to remove the tick against the Keep checked out check box, in order to make the files read only. Click the OK button to move the files to VSS and you are done with it.

How to start your business with VSS from within the environment

Your business with VSS is a few clicks away. In order to achieve that you need to follow the following steps.

Steps to start using VSS

  1. Right click the VC++ IDE’s toolbar. You will see the popup menu as shown in fig. 11 below.
  2. Select Source Control option from this menu.
  3. You will notice a new toolbar Source Control, as shown in Fig 12.
  4. You can use VSS from this toolbar. The details are described in the next section.

Fig. 11 Popup menu to select VSS option

Fig. 12 VSS toolbar

Source Control toolbar (from left to right in the image).

  1. Get Latest Version: Retrieves a read-only copy of the selected VSS items.
  2. Check Out: Copies the latest version of one or more selected files from the current project into your current working folder.
  3. Check In: Updates VSS with changes made to a checked-out file, and unlocks the VSS master copy.
  4. Undo Check Out\; Cancels a Check Out operation, undoing all changes. You must have a working folder set for this command to work properly.
  5. Add To Source Control: Invokes the Add to Source Control Dialog shown in fig 8.
  6. Remove From Source Control: Removes the project from VSS.
  7. Show History: Shows the history of a file or project in VSS.
  8. Show Differences: compares the local copy of your code file to the one in VSS, and shows how they differ (in a text display).
  9. Source Control Properties: This will invoke a dialog as shown below, when you select one of your code files.

    Fig 13 Dialog shows the properties of a file in VSS.

  10. Share from Source Control: VSS projects are in many ways analogous to operating system folders. However, whereas every file in an operating system exists uniquely in a folder, a VSS file can simultaneously exist in many different projects.

    In VSS, you can share files. Inside the VSS database, there is only one copy, the master copy, of the file; each project to which the file belongs simply has a pointer to that copy. When you change the file in any one project, VSS immediately updates it in all the projects that share it. For more information on Sharing of projects and files please see Share Files in your MSDN documentation.

  11. Refresh Status: Refresh the status of your project files.
  12. Source Control: This will execute the Visual SourceSafe software.

You can also use the Project->Source Control menu item to use the above functionality.

Some useful tips

  1. How to know whether your files are checked in or checked out:

    If you open your workspace and select the File View tab of the workspace window, you will notice that the files are all marked in gray color, which means that your workspace is checked in. This is a confirmatory test to know whether your files are checked out or checked in.

    Fig 14 File View indicates checked in files.

  2. How to know whether a particular file is checked out or checked in:

    To know the status of a file, i.e. whether it is checked out or checked in, just open the file and right click on the open file, and select ‘Properties’ from the popup menu. You will get the following dialog:

    Fig. 15. Dialog indicates the status of a file in VSS.

    You will be able to notice the status of the file inside the ‘Status:’ edit control. An alternative way to know this information is to look in to Class View tab of your workspace window. If both the header file (.h or. hpp) and code file (.cpp or .c) are checked out, you will see a red tick associated with the particular C++ class. If only one of them is checked out, then you will see a black tick associated with the particular C++ class that is checked out.

Conclusion

It is very simple and effective to use VSS from your development environment, rather than opening the VSS software separately. I hope this approach will surely improve your efficiency as regards usage of VSS, as well as encourage you to do source-safing from the VC++ development environment.

Happy Source-safing all the way!!!<!------------------------------- That's it! --------------------------->

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

Ashutosh R. Bhatikar
Team Leader Symphony Services Private Limited.
India India
I have been working with Symphony Services for the past 4 years and have a total of 9+ years experience in Software Development. I have worked mostly in C, C++, MFC, COM/DCOM/COM+. My specialization is in GUI development and Image Processing. I hold a Bachelors Degree in Engineering (Computer) from University of Goa.

Comments and Discussions

 
GeneralRemove from Source Control does not works in VC++ 6.0 Pinmembersandeep222910-Aug-06 0:26 
QuestionExtending VSS toolbar Pinmembersandeep222919-Apr-06 1:14 
GeneralVss VS 2003 .NET Integration Pinmemberbuczkow9-Apr-06 22:07 
Generaladd file to vss by using vs.net Pinmemberadv20056-Mar-06 0:10 
GeneralRe: add file to vss by using vs.net PinmemberAshutosh R. Bhatikar6-Mar-06 0:52 
GeneralVSS integration Pinmembershijuck7-Dec-04 19:53 
GeneralRe: VSS integration PinmemberAshutosh R. Bhatikar7-Dec-04 20:52 
GeneralRe: VSS integration PinmemberVaclav27-Apr-05 22:02 
GeneralRe: VSS integration PinmemberAshutosh R. Bhatikar28-Apr-05 1:12 
Hi Vaclav,
 
Thanks for your response. If you have installed VSS, the you will have the following entries in the Registry
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SourceSafe
 
1. SCCServerName - Microsoft Visual SourceSafe
 
2. SCCServerPath - C:\Program Files\Microsoft Visual Studio\Common\VSS\win32\SSSCC.DLL
 
This path may differ on your system. Please see if this entry exist. If not, then please search for SSSCC.DLL on your system and copy the file path to this key.
 
This DLL is the VSS Source Code Control Provider.
 
In the worst case, if this DLL does not exist, you may have to re-install VSS from the Visual Studio CD.
 
3. PromptForConnect - 1 (must be 1)
 
Hope this helps.

 
Ashutosh Bhatikar
GeneralRe: VSS integration PinmemberVaclav28-Apr-05 19:26 
GeneralVSS only good for small projects PinmemberTidhar12-Aug-03 19:53 
GeneralRe: VSS only good for small projects (Not True) PinmemberAnil Popli12-Aug-03 20:53 
GeneralRe: VSS only good for small projects (Not True) PinmemberTidhar12-Aug-03 20:56 
GeneralBroken VC++ Sourcesafe link Pinmemberworksopbenny12-Aug-03 15:40 
GeneralRe: Broken VC++ Sourcesafe link PinmemberAshutosh R. Bhatikar12-Aug-03 18:08 
GeneralRe: Broken VC++ Sourcesafe link Pinsusstheschmitzer11-Apr-05 14:50 
GeneralRe: Broken VC++ Sourcesafe link PinsussAnonymous28-Sep-05 20:11 
QuestionVSS everybody's choise? PinmemberVaclav8-Aug-03 5:59 
AnswerRe: VSS everybody's choise? Pinmember.:fl0yd:.8-Aug-03 10:28 
GeneralWho said that?!! PinsussAnonymous7-Aug-03 7:28 
GeneralRe: Who said that?!! PinmemberAshutosh R. Bhatikar7-Aug-03 17:57 
GeneralRe: Who said that?!! PinmemberPerfectDark7-Aug-03 22:28 
GeneralRe: Who said that?!! PinsussAnonymous16-Aug-03 2:44 
GeneralRe: Who said that?!! PinsussAnonymous8-Aug-03 7:11 
GeneralRe: Who said that?!! PinsussAnonymous8-Aug-03 20: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 | Mobile
Web03 | 2.8.140721.1 | Last Updated 7 Aug 2003
Article Copyright 2003 by Ashutosh R. Bhatikar
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid