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
' 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
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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.