Solved

Sourcesafe api (IVSSItem)  in Delphi

Posted on 2006-10-21
11
698 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

696 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