Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Sourcesafe api (IVSSItem)  in Delphi

Posted on 2006-10-21
11
Medium Priority
?
721 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 255 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 255 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
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!

 
LVL 26

Assisted Solution

by:EddieShipman
EddieShipman earned 120 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses
Course of the Month12 days, 15 hours left to enroll

971 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