×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Microsoft: Visual SourceSafe FAQ

SourceSafe Automation

How to Disable check in for users. by hammy
Posted: 5 Jan 04

This code was originally downloaded from Microsoft's website, however after much searching I can no longer find this code. I found it useful so possibly others may to. The only code that I have inserted at this time is to disable check in, however it is possible to automate other options.

Create a project called SCMonitor.

Create a class within this called CVSS and Paste in the code below. Once you have built the DLL all you have to do to install this is to do the following :

Copy the scmonitor* build files into C:\winnt\system32 and register it using

regsvr32 scmonitor

Edit or create the ssaddin.ini file in the following folder

disk:\Program Files\Microsoft Visual Studio\Common\VSS\win32

and include the line

scmonitor.cvss = 1

Hammy.


Here is the code for CVSS.cls

==========================================================
Option Explicit

Implements IVSSEventHandler

Private WithEvents moVSS As VSSApp

' This function returns the Windows Temp directory
Private Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Private Const MODULE_NAME As String = "CVSS"
Public strCCLRef As String
Public StrComment As String
Public strProgrammer As String
Public strTester As String
Public strVersion As String

Private Function moVSS_BeforeAdd(ByVal Prj As IVSSItem, ByVal LocalSpec As String, ByVal Comment As String) As Boolean
    moVSS_BeforeAdd = True
    strCCLRef = ""
    StrComment = ""
    strProgrammer = ""
    strTester = ""
    strVersion = ""
End Function

Private Sub moVSS_AfterAdd(ByVal Item As IVSSItem, ByVal LocalSpec As String, ByVal Comment As String)
    '
    strCCLRef = ""
    StrComment = ""
    strProgrammer = ""
    strTester = ""
    strVersion = ""
End Sub

Private Function moVSS_BeforeBranch(ByVal Item As IVSSItem, ByVal Comment As String) As Boolean

    moVSS_BeforeBranch = True
    strCCLRef = ""
    StrComment = ""
    strProgrammer = ""
    strTester = ""
    strVersion = ""
    
End Function

Private Sub moVSS_AfterBranch(ByVal Item As IVSSItem, ByVal Comment As String)
    '
    strCCLRef = ""
    StrComment = ""
    strProgrammer = ""
    strTester = ""
    strVersion = ""
End Sub

Private Function moVSS_BeforeCheckIn(ByVal Item As IVSSItem, ByVal LocalSpec As String, ByVal Comment As String) As Boolean

Dim gcnnModifications As ADODB.Connection
Dim rstModificationsADO As New ADODB.Recordset
Dim gcnnCCL As ADODB.Connection
Dim rstCCLADO As ADODB.Recordset
Dim strSource As String
Dim strDestination As String

    MsgBox "Check in Disabled"
    moVSS_BeforeCheckIn = False
    
End Function

Private Sub moVSS_AfterCheckIn(ByVal Item As IVSSItem, ByVal LocalSpec As String, ByVal Comment As String)
    '
End Sub

Private Function moVSS_BeforeCheckOut(ByVal Item As IVSSItem, ByVal LocalSpec As String, ByVal Comment As String) As Boolean

Dim gcnnCCL As ADODB.Connection
Dim rstCCLADO As ADODB.Recordset
Dim strCCLRef As String

    moVSS_BeforeCheckOut = True
    StrComment = ""
    strProgrammer = ""
    strTester = ""
    strVersion = ""
End Function

Private Sub moVSS_AfterCheckOut(ByVal Item As IVSSItem, ByVal LocalSpec As String, ByVal Comment As String)
    '
    strCCLRef = ""
    StrComment = ""
    strProgrammer = ""
    strTester = ""
    strVersion = ""
    '
End Sub

Private Function moVSS_BeforeRename(ByVal Item As IVSSItem, ByVal NewName As String) As Boolean
    moVSS_BeforeRename = True
    strCCLRef = ""
    StrComment = ""
    strProgrammer = ""
    strTester = ""
    strVersion = ""
End Function

Private Sub moVSS_AfterRename(ByVal Item As IVSSItem, ByVal OldName As String)
    '
    strCCLRef = ""
    StrComment = ""
    strProgrammer = ""
    strTester = ""
    strVersion = ""
    '
End Sub

Private Function moVSS_BeforeUndoCheckOut(ByVal Item As IVSSItem, ByVal LocalSpec As String) As Boolean
    moVSS_BeforeUndoCheckOut = True
    strCCLRef = ""
    StrComment = ""
    strProgrammer = ""
    strTester = ""
    strVersion = ""
End Function

Private Sub moVSS_AfterUndoCheckOut(ByVal Item As IVSSItem, ByVal LocalSpec As String)
    strCCLRef = ""
    StrComment = ""
    strProgrammer = ""
    strTester = ""
    strVersion = ""
    '
End Sub

Private Function moVSS_BeginCommand(ByVal unused As Long) As Boolean
    moVSS_BeginCommand = True
End Function

Private Sub moVSS_EndCommand(ByVal unused As Long)
    '
End Sub

Private Function moVSS_BeforeEvent(ByVal iEvent As Long, ByVal Item As IVSSItem, ByVal Str As String, ByVal Var As Variant) As Boolean
    moVSS_BeforeEvent = True
End Function

Private Sub moVSS_AfterEvent(ByVal iEvent As Long, ByVal Item As IVSSItem, ByVal Str As String, ByVal Var As Variant)
    '
    '
End Sub

Private Sub IVSSEventHandler_Init(ByVal pIVSS As SourceSafeTypeLib.IVSS)
    Set moVSS = pIVSS
    strCCLRef = ""
    StrComment = ""
    strProgrammer = ""
    strTester = ""
    strVersion = ""
End Sub

Back to Microsoft: Visual SourceSafe FAQ Index
Back to Microsoft: Visual SourceSafe Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close