Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Disable check in for users.

SourceSafe Automation

How to Disable check in for users.

by  hammy  Posted    (Edited  )
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
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top