Solved

Sourcesafe api (IVSSItem)  in Delphi

Posted on 2006-10-21
11
682 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

929 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

13 Experts available now in Live!

Get 1:1 Help Now