Click here to Skip to main content
15,878,852 members
Articles / Programming Languages / C++
Article

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

Rate me:
Please Sign up or sign in to vote.
3.81/5 (19 votes)
6 Aug 20037 min read 110.3K   26   26
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.

    Image 1

    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:

Image 2

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.

Image 3

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.

Image 4

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.

Image 5

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.

Image 6

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.

Image 7

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.

Image 8

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.

Image 9

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.

Image 10

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.

Image 11

Fig. 11 Popup menu to select VSS option

Image 12

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.

    Image 13

    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.

    Image 14

    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:

    Image 15

    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!!!

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


Written By
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 Pin
sandeep222910-Aug-06 0:26
sandeep222910-Aug-06 0:26 
QuestionExtending VSS toolbar Pin
sandeep222919-Apr-06 1:14
sandeep222919-Apr-06 1:14 
GeneralVss VS 2003 .NET Integration Pin
buczkow9-Apr-06 22:07
buczkow9-Apr-06 22:07 
Generaladd file to vss by using vs.net Pin
adv20056-Mar-06 0:10
adv20056-Mar-06 0:10 
GeneralRe: add file to vss by using vs.net Pin
Ashutosh R. Bhatikar6-Mar-06 0:52
Ashutosh R. Bhatikar6-Mar-06 0:52 
GeneralVSS integration Pin
shijuck7-Dec-04 19:53
shijuck7-Dec-04 19:53 
GeneralRe: VSS integration Pin
Ashutosh R. Bhatikar7-Dec-04 20:52
Ashutosh R. Bhatikar7-Dec-04 20:52 
GeneralRe: VSS integration Pin
Vaclav27-Apr-05 22:02
Vaclav27-Apr-05 22:02 
GeneralRe: VSS integration Pin
Ashutosh R. Bhatikar28-Apr-05 1:12
Ashutosh R. Bhatikar28-Apr-05 1:12 
GeneralRe: VSS integration Pin
Vaclav28-Apr-05 19:26
Vaclav28-Apr-05 19:26 
GeneralVSS only good for small projects Pin
tidhar12-Aug-03 19:53
tidhar12-Aug-03 19:53 
GeneralRe: VSS only good for small projects (Not True) Pin
Anil Popli12-Aug-03 20:53
Anil Popli12-Aug-03 20:53 
GeneralRe: VSS only good for small projects (Not True) Pin
tidhar12-Aug-03 20:56
tidhar12-Aug-03 20:56 
GeneralBroken VC++ Sourcesafe link Pin
worksopbenny12-Aug-03 15:40
worksopbenny12-Aug-03 15:40 
GeneralRe: Broken VC++ Sourcesafe link Pin
Ashutosh R. Bhatikar12-Aug-03 18:08
Ashutosh R. Bhatikar12-Aug-03 18:08 
GeneralRe: Broken VC++ Sourcesafe link Pin
theschmitzer11-Apr-05 14:50
susstheschmitzer11-Apr-05 14:50 
GeneralRe: Broken VC++ Sourcesafe link Pin
Anonymous28-Sep-05 20:11
Anonymous28-Sep-05 20:11 
QuestionVSS everybody's choise? Pin
Vaclav8-Aug-03 5:59
Vaclav8-Aug-03 5:59 
AnswerRe: VSS everybody's choise? Pin
.:floyd:.8-Aug-03 10:28
.:floyd:.8-Aug-03 10:28 
GeneralWho said that?!! Pin
Anonymous7-Aug-03 7:28
Anonymous7-Aug-03 7:28 
GeneralRe: Who said that?!! Pin
Ashutosh R. Bhatikar7-Aug-03 17:57
Ashutosh R. Bhatikar7-Aug-03 17:57 
GeneralRe: Who said that?!! Pin
PerfectDark7-Aug-03 22:28
PerfectDark7-Aug-03 22:28 
GeneralRe: Who said that?!! Pin
Anonymous16-Aug-03 2:44
Anonymous16-Aug-03 2:44 
GeneralRe: Who said that?!! Pin
Anonymous8-Aug-03 7:11
Anonymous8-Aug-03 7:11 
GeneralRe: Who said that?!! Pin
Anonymous8-Aug-03 20:13
Anonymous8-Aug-03 20:13 

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

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