Visual SourceSafe and Visual Basic

Sharing Files in Visual SourceSafe

In this exercise you will share a Visual Basic form with multiple projects.
Note

Before doing this exercise, you must complete the Using Visual SourceSafe exercise that appears earlier in this chapter.


* To Create a new Visual SourceSafe Project

  1. In the Visual SourceSafe Explorer, select the root project "$/" in the All projects treeview.
  2. From the toolbar, click Create Project .
  3. In the Project box of the Create Project dialog, type Shared Objects and then click OK .
  4. In the All projects treeview, select Shared Objects .
  5. From the toolbar, click Create Project .
  6. In the Project box of the Create Project dialog type Login .
  7. In the All projects treeview, select Login .
  8. From the toolbar, click Add Files .
  9. Browse for the folder WA\Practice\Ch13\Shared\Login .
  10. Select all the files in the file list and then click Add .
  11. Leave the comment blank and click OK .
  12. Click Yes to set WA\Practice\Ch13\Shared\Login as your personal working folder.
  13. Click Close to return to the Visual SourceSafe Explorer.

* To share the Login form with other Visual SourceSafe projects

  1. In the All projects treeview, select Hubble .
  2. From the toolbar, click Share .

    This opens the Share with $/Hubble dialog.

  3. In the Projects list, double-click Shared Projects and then click Login .
  4. In the File to share list, select frmLogin.frm then click Share .
  5. Click Close to return to the Visual SourceSafe Explorer.

    Notice frmLogin.frm has been added to the Contents list of the Hubble project. This icon is different from the rest to indicate that this file is shared with another Visual SourceSafe projects. The frmLogin.frm file is also copied to the working directory of the Hubble project.

  6. Repeat steps 1 to 5 to share frmLogin with the NASA project.
* To add the Login form to the Hubble and NASA projects
  1. From Visual Basic, open the Hubble project.
  2. Click Add Form on the Project menu.
  3. Click the Existing tab and select frmLogin.frm , then click Open .

    If you get a message saying "Project file is read-only," close the message box and Check Out the project from Visual SourceSafe. Now you will be able to add the Login form to the project. Since the Hubble.vbp file stores information about which files are included in your project, Visual Basic will not let you add any files to the project unless the project file (.vbp) file is checked out. Repeat Step 3 if necessary.

  4. Click OK to the message indicating that Visual Basic failed to add this form to the Visual SourceSafe project.

    This message appears because the file has already been added to Visual SourceSafe.

  5. In the Project Explorer, right-click frmLogin and click Check Out .
  6. Repeat Step 5 to check frmLogin back into Visual SourceSafe.

    When you check the file out and then back in, Visual Basic updates the icon used in the Project Explorer. Notice how it differs from the other icons in the Project explorer. This is because this form is shared with other projects.

  7. Save your project.
  8. Repeat steps 1 to 7 for the NASA project.

* To check shared files out and in of Visual SourceSafe

  1. With the NASA project open, from the Project Explorer, right-click frmLogin.frm and select Check Out .
  2. Switch to the Visual SourceSafe Explorer and notice that the file is checked out of all three projects we have added. If the Visual SourceSafe Explorer does not have the files marked as checked out, click Refresh File List from the View menu.
  3. Switch to Visual Basic and check in the frmLogin.frm form.


Microsoft Windows Architecture Training
Microsoft Windows Architecture for Developers Training Kit
ISBN: B00007FY9D
EAN: N/A
Year: 1998
Pages: 324

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net