Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

BUG: Vss Addin w/Hotfix

26 views
Skip to first unread message

Paul D'Anna

unread,
Oct 11, 2002, 6:30:22 PM10/11/02
to
VSS Support its been a couple of weeks since I posted this, so I thought I
would try it again to see if anyone else has "experienced" this feature.. :)

I got the Q319448 hotfix code to resolve the "Incorrect code message" I got
using a VSS Addin with my VS.Net Addin (I'm
trying to add additional functionality at the solution, project, file event
level to VS.Net. It failed miserably.. It seems that via the VS.Net Addin
the init code is being called twice and that althought the "Invalid code"
message is gone, it seems that none of the VSS events other than "Init /
Begin command / End command" are ever being called.

So I stepped back and created just a bare bones Vss Addin using the code
that Ryan Cromwell posted previously to this group. And using only Vss
Explorer, it caught the init and only the begin/end command events, but any
other VSS event handlers did not fire and the command
did not work (checkout displayed and completed the checkout dialog, but the
file list was not updated to display it as checked out). On startup I a saw
the VssAddin fire (Init, Begin/End, Begin/End, Begin/End) before displaying
the file list.

So I starting debugging via my VS.Net Addin and I was able to open a source
controlled solution, and saw the VssAddin fire (Init/End, Init/End,
Begin/End) in opening the solution, but would not fire any other events
after that. I was however able to do checkout/checkin/undo checkout and VSS
reported the checkout correctly (even though it never let me intercept those
events).

Any thoughts on what might be wrong. Any testing done on using this support
at all? Plans for making DTE.SourceControl more robust (how about adding
CheckIn?)

TIA,
Paul.

Alin Constantin

unread,
Oct 13, 2002, 11:02:21 PM10/13/02
to
Hi Paul,

The SourceControl is an automation interface and all methods it exposes are
UI-less.
The Checkin operation requires UI to be displayed sometimes (e.g. in the
case of a merge conflict),
making this operation unsuitable for automation, where user intervention
shouldn't be required.
--
Alin Constantin
Email (reversed for spam avoidance) moc.tfosorcim@cnila
This posting is provided "AS IS" with no warranties, and confers no rights.

"Paul D'Anna" <pda...@iname.com> wrote in message
news:eYhqdWXcCHA.1652@tkmsftngp11...

Paul D'Anna

unread,
Oct 14, 2002, 11:51:58 AM10/14/02
to
Alin,

Understood that it must be UI-less, but that doesn't mean that there
shouldn't be a UI-less base checkin method that could be used to update the
status of a file. The automation interfaces should allow the external user
flexibility to construct his own external UI interface and not limit usage
based on its own UI requirements (because it shouldn't have any). .

Any thoughts on the rest of the question about whether the Addin works based
on my tests.

Paul.

"Alin Constantin" <moc.tfosorcim@cnila> wrote in message
news:OHEvw3ycCHA.2496@tkmsftngp12...

Benoit Poirier

unread,
Oct 16, 2002, 9:26:22 AM10/16/02
to
A year ago I faced that problem and Ms solved it and it worked (for
me). If I remember well, you need to use some weird code to start the
addin (look like what c++ programmer do to use a COM) AND you need to
have an updated version of some source safe component. Dou you have
both? I can try to find if I still have the example code MS sent me,
but for updated component you will need to contact MS.

On Fri, 11 Oct 2002 15:30:22 -0700, "Paul D'Anna" <pda...@iname.com>
wrote:

Benoit Poirier

unread,
Oct 16, 2002, 9:27:46 AM10/16/02
to
Are you sure you give the right Q number, I can't find it anywhere.
The Q you provided lead me to that article: Possible Memory Leak with
MIME or SMIME Encryption...

On Fri, 11 Oct 2002 15:30:22 -0700, "Paul D'Anna" <pda...@iname.com>
wrote:

>VSS Support its been a couple of weeks since I posted this, so I thought I

Benoit Poirier

unread,
Oct 16, 2002, 9:48:33 AM10/16/02
to
I find the code:


Option Explicit On
Option Strict On

Imports System
Imports System.Runtime.InteropServices
Imports SourceSafeTypeLib

Public Class MyVSSEventHandler
Implements IVSSEventHandler
Implements IDisposable

Public Shared pVSSApp As VSSApp

Private VSSEventsHandler As New CVSSEvents()
Private cpVSSEvents As UCOMIConnectionPoint
Private ckVSSEvents As Integer

Public Sub Init(ByVal pIVSS As VSSApp) _
Implements IVSSEventHandler.Init

pVSSApp = pIVSS
Dim cpc As UCOMIConnectionPointContainer
Dim IID_IVSSEvents As Guid = GetType(IVSSEvents).GUID
cpc = CType(pIVSS, UCOMIConnectionPointContainer)
cpc.FindConnectionPoint(IID_IVSSEvents, cpVSSEvents)
cpVSSEvents.Advise(VSSEventsHandler, ckVSSEvents)
End Sub

Public Sub Dispose() Implements System.IDisposable.Dispose
cpVSSEvents.Unadvise(ckVSSEvents) 'Libérer la connection
End Sub
End Class

Friend Class CVSSEvents
Implements IVSSEvents


Public Sub AfterAdd(ByVal pIItem As VSSItem, _
ByVal Local As String, _
ByVal Comment As String) _
Implements IVSSEvents.AfterAdd
'TODO
End Sub

Public Sub AfterBranch(ByVal pIItem As VSSItem, _
ByVal Comment As String) _
Implements IVSSEvents.AfterBranch
'TODO
End Sub

Public Sub AfterCheckin(ByVal pIItem As VSSItem, _
ByVal Local As String, _
ByVal Comment As String) _
Implements IVSSEvents.AfterCheckin
'TODO
End Sub

Public Sub AfterCheckout(ByVal pIItem As VSSItem, _
ByVal Local As String, _
ByVal Comment As String) _
Implements IVSSEvents.AfterCheckout
'TODO
End Sub

Public Sub AfterEvent(ByVal iEvent As Integer, _
ByVal pIItem As VSSItem, _
ByVal Str As String, _
ByVal var As Object) _
Implements IVSSEvents.AfterEvent
'TODO
End Sub

Public Sub AfterRename(ByVal pIItem As VSSItem, _
ByVal OldName As String) _
Implements IVSSEvents.AfterRename
'TODO
End Sub

Public Sub AfterUndoCheckout(ByVal pIItem As VSSItem, _
ByVal Local As String) _
Implements
IVSSEvents.AfterUndoCheckout
'TODO
End Sub

Public Function BeforeAdd(ByVal pIPrj As VSSItem, _
ByVal Local As String, _
ByVal Comment As String) As Boolean _
Implements IVSSEvents.BeforeAdd
'TODO
Return True
End Function

Public Function BeforeBranch(ByVal pIItem As VSSItem, _
ByVal Comment As String) As Boolean _
Implements IVSSEvents.BeforeBranch
'TODO
Return True
End Function

Public Function BeforeCheckin(ByVal pIItem As VSSItem, _
ByVal Local As String, _
ByVal Comment As String) As Boolean
_
Implements IVSSEvents.BeforeCheckin
'TODO
Return True
End Function

Public Function BeforeCheckout(ByVal pIItem As VSSItem, _
ByVal Local As String, _
ByVal Comment As String) As Boolean
_
Implements
IVSSEvents.BeforeCheckout
'TODO
Return True
End Function

Public Function BeforeEvent(ByVal iEvent As Integer, _
ByVal pIItem As VSSItem, _
ByVal Str As String, _
ByVal var As Object) As Boolean _
Implements IVSSEvents.BeforeEvent

'TODO
Return True
End Function

Public Function BeforeRename(ByVal pIItem As VSSItem, _
ByVal NewName As String) As Boolean _
Implements IVSSEvents.BeforeRename
'TODO
Return True
End Function

Public Function BeforeUndoCheckout(ByVal pIItem As VSSItem, _
ByVal Local As String) As
Boolean _
Implements
IVSSEvents.BeforeUndoCheckout
'TODO
Return True
End Function

Public Function BeginCommand(ByVal unused As Integer) As Boolean _
Implements IVSSEvents.BeginCommand
'TODO
Return True
End Function

Public Sub EndCommand(ByVal unused As Integer) _
Implements IVSSEvents.EndCommand
'TODO
End Sub

End Class


Paul D'Anna

unread,
Oct 16, 2002, 12:22:11 PM10/16/02
to
Thanks Benoit, Mine is in C#, so I'll give it a go at translating it... Also
the fix was Q319948 for the invalid code, which I already have the patch
for.

Paul

"Benoit Poirier" <ms...@codasys.net> wrote in message
news:3dad6dee...@msnews.microsoft.com...

0 new messages