Any VSS addin sample that works?

Hi,

I have tried to create the sample C# VSS addin described here:

http://msdn2.microsoft.com/library/hcdf9zk2(en-us,vs.80).aspx

but no event is being trapped. Actually, the COM component is not even registered.

Any pointer to a working demo/sample

Thanks in advance.


Answer this question

Any VSS addin sample that works?

  • XPolter

    Finally, this appears to be a VS 2005 beta 2 bug , not a problem with VSS itself.

    I have tried to generate a typelib from various .Net components and I always get the same result: empty typelibs. Other developers have observed the same behavior as well. Beta 1 apparently has the same problem.

  • rtelford

    Also, I think that the suggested location for ssaddin.ini ( ..\Microsoft Visual Studio\VSS\win32) is wrong. It should be in the same folder as ssapi.dll, I guess.


  • AJ_Developer

    O.k, I figured it out by myself.

    It was becuase of a line of code in my VSS2005 help file.

    ~IvssEventSample()
    {
    // Unwire the connection point (see Init)
    vssEvents.Unadvise(cookie);
    }

    My local copy of msdn has the same the code as above, but

    This destructor is empty in msdn online and crashing issue disappeared by commenting this code.



  • Derek Ju

    First, I'm using VSS2005.

    The C# VSS addin sample works fine, but VSS explorer crashes while closing.

    One more thing. Where should I place "VSSEvents.dll" Same folder as "ssaddin.ini" goes

    Thanks in advance. Extra thanks to anybody who answers.



  • Zhang Michael

    You can get the sample working by doing the following:

    1. There is a ; missing  at line 3: using System.Runtime.InteropServices.ComTypes

    2. Add the extra line as commented:

    [Guid("E1916BD8-A8AA-47b7-A862-C1AF995E64EF")]

    [ComVisible(true)] //this is the line you have to add; this value is false by default

    public class IvssEventSample : IVSSEventHandler, IVSSEvents


    3. In the ssaddin.ini file, add the name of the ProgID you created Microsoft.SourceSafe.EventSample = 1
    instead of
    Microsoft.SourceSafe.EventSam = 1

    Double check, in HKCR -> CLSID -> {E1916BD8-A8AA-47b7-A862-C1AF995E64EF} -> ProgID (the name here is the name that goes in your ssaddin.ini file)

    4. Create the ssaddin.ini file in the same folder as ssapi.dll (If it happens to be ..\Microsoft Visual Studio\VSS\win32, so be it)

    This should get the sample working for you.

    You might find this link helpful:
    http://msdn.microsoft.com/library/default.asp url=/library/en-us/dnvss/html/vssauto.asp


  • Pandit

    I have tried to generate and register the typelib from VSSEvents.dll with regasm but it seems that the generated typelib is almost empty. No wonder that the addin doesn't work. So obviously the compilation doesn't generate the correct Interop information.

    However, the "Register for COM Interop" option has been checked.

  • Dhericean

     MainSoft wrote:
    I have tried to generate and register the typelib from VSSEvents.dll with regasm but it seems that the generated typelib is almost empty. No wonder that the addin doesn't work. So obviously the compilation doesn't generate the correct Interop information.
    Blind as I am, I didn't see the warning when compiling: "[that DLL] does not contain any types that can be registered for COM Interop".

    However, all the class members are public, there's a default constructor and everything in the code appears to comply with COM Interop rules for exposing .Net types to COM.

    I don't understand.


  • Dharmesh M Mehta

    Is there a Visual Basic version of the sample addin for trapping Visual SourceSafe events

    I am converting a VB addin from VB6 to VB under Visual Studio 2005. The Init() method of the new addin is being called, but none of my event methods are being called.

    Thanks,

    Frank

  • Any VSS addin sample that works?