Solved

Sourcesafe api (IVSSItem)  in Delphi

Posted on 2006-10-21
11
671 Views
Last Modified: 2008-01-09
Could some one tell me if it's possible/how to using to invoke the diff functionality in visual sourcesafe in delphi (version 4) ( preferably without usinf third party tools)?

Also how do i acess the version information/checking comments for an item please?

any sample source code would be appreciated

tks


0
Comment
Question by:KevinBadger
  • 6
  • 2
  • 2
11 Comments
 
LVL 17

Accepted Solution

by:
Wim ten Brink earned 85 total points
ID: 17787408
If I'm not mistaken, VSS has an automation interface. So all you would have to do is import this as a type library in your project and then check the functionality that it provides to you. Have you tried using that directly?
0
 

Author Comment

by:KevinBadger
ID: 17790167
i've tried importing SourceSafeTypeLib_TLB which is where i get IVSSItem from but it soen't seem to have  much functionality
0
 
LVL 17

Assisted Solution

by:Wim ten Brink
Wim ten Brink earned 85 total points
ID: 17793861
Well, if you have imported the type library then also look at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvss/html/vssauto.asp for more information.
A Google search for http://www.google.nl/search?hl=en&q=SourceSafeTypeLib&btnG=Google+Search is how I found that one, btw. :-)
0
 
LVL 26

Assisted Solution

by:EddieShipman
EddieShipman earned 40 total points
ID: 17821950
In order to check the DIFF on an item, do something like this:
(loose translation of some VBS code I have)

procedure VSSCheckin(AVSSIniFile, AFileName, AVSSItemPath, AVSSUserName, AVSSPassword: String;
                     ACheckinIfDiff: Boolean; ACheckInComment: String; AExclusive: Boolean = True);
var
  oVSSItem: IVSSItem;
  oVSSDatabase: IVSSDatabase;
  iFlags: Integer;
begin
  if AExclusive then
    iFlags := VSSCHECKOUT_EXCLUSIVE
  else
    iFlags := VSSCHECKOUT_SHARED;
  // Create the Database object
  oVSSDatabase := CreateOleObject('SourceSafe') as IVSSDatabase;
  try
    oVSSDatabase.Open(AVSSIniFile, AVSSUserName, AVSSPassword);
    oVSSItem := oVSSDatabase.VSSItem[AVSSItemPath, False];
    // Check it out
    oVSSItem.Checkout('Checked out by automated process', AFileName, iFlags);
    if (oVSSItem.IsDifferent[AFileName]) and (ACheckinIfDiff) then
    begin
      oVSSItem.Checkin(ACheckInComment, AFileName, iFlags);
    end
    oVSSDatabase.Close;
  finally
    oVSSDatabase := nil;
  end;
end;


I don't have the VSS TypeLib imported because I can't find it even though I have VSS Installed on
my system. Oh, wait, here it is... Let me double check that code before I finish this post...

Since I am going to begin working on a VSS project, I needed to know how to do that and I
posted code that works.
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 17822027
If you need more, llike how to get the individual version comments, let me know.
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 26

Expert Comment

by:EddieShipman
ID: 17901502
KevinBadger, have you tried any of our solutions?
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 17902320
Wow, a 'B' for that, huh? You may need to be a little more careful about your grading in the future if you
want expert help.
0
 

Author Comment

by:KevinBadger
ID: 17908762
Sorry Eddie,
I didn't take time to read throught properly.
I was looking for a diff as in file comparison  (Sourcesafe "show differences") though. I suppose I could just launch the diff app if its available as aseperate executable
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 17910078
It was not clear what you wanted to do. I do not know if showing the diff from the VSSItem woul duse the external diff util or not. I will test that and get back with you.
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 18237412
From Alin Constantin at:
https://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1057737&SiteID=1

...

IVSS is an automation interface, therefore there is no UI associated with it.

If you use VSS 6.0 IVSS API, there is an unsupported Diff-Merge OCX control
providing the diff-merge UI. It is included with the SourceSafe Automation
Sample written by Tim Winter. It's available at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvss/html/msdn_vssole.asp

If you use VSS 2005, the functionality of the unsupported control has been
replaced with command line invocation of SourceSafe Explorer. Syntax and
examples for Edit/View/Diff/Merge can be found at:
http://msdn2.microsoft.com/en-us/library/ms181130(VS.80).aspx
...


0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now