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

x
?
Solved

Can anyone get Microsoft's diffmergectl.ocx to work?

Posted on 2004-10-04
11
Medium Priority
?
534 Views
Last Modified: 2010-05-18
MS distribute diffmergectl.ocx as an unsupported tool. It is supposed to allow access to MS Visual sourceSafe's Diff and Merge facilities.
I retrieved the file from the Visual Studion installation disks, placed it in my Visual Studio 6.0 ..\vss\win32 folder and registered it with regsvr32.exe.

However, when I try to instantiate it in a VB script, I get "Catastrophic Error".

Any ideas?
0
Comment
Question by:gerard_odonnell
  • 6
  • 5
11 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 12221414
What do you mean by VB script?  Do you have some source code to show your situation?

Bob
0
 

Author Comment

by:gerard_odonnell
ID: 12222281
Save this text as a file with a .vbs extension and run it using cscript:

Dim Merge
Set Merge = CreateObject("DIFFMERGECTL.ViewerCtrl.1")

If Merge Is Nothing Then
      MsgBox "Nada"
Else
      Merge.AboutBox()
End If

Result:
The AboutBox call results in a "catastrophic failure" message from cscript.
And maybe I am a failure but not a catastrophic one hopefully.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 12225885
Try adding a COM reference to the DiffMerge control.  You should get a COM wrapper class reference in your project reference list.  Then try early-binding this control, instead of late-binding (CreateObject).

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

 

Author Comment

by:gerard_odonnell
ID: 12230628
Thanks Bob but as far as I know, vb script doesn't support early binding.
If I try to use what I think is early binding e.g  a statement like "Set Merge = New DIFFMERGECTL.ViewerCtrl.1", cscript gives me a VBScript compilation error.

Is it possible that the control does not support automation?
Maybe there is some way to determine from the ocx's type library if it supports automation or has to be instantiated in a control container?
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 12230667
How are you implementing this?  What do you mean by cscript and VBScript?  Are you working with VB.NET?

Bob
0
 

Author Comment

by:gerard_odonnell
ID: 12230838
Sorry - let me clarify : I'm hoping to instantiate the diifmerge activeX control via Windows Script Host (WSH) in Windows 2000. I'm using scripting since my knowledge of Visual Basic is very limited and so I can change my script without recompiling a VB application.

cscript.exe is the command-line tool in Windows for running these scripts, which are typically in Microsoft's vbscript or jscript scripting languages.

Maybe what I'm trying to do doesn't make sense but I was hoping to use my script to automate Microsoft Visual SourceSafe in a development environment. I'd like to make a script which can diff source code on a developer's machine against what's in the SourceSafe database. SourceSafe's front end is very limited.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 12230947
Ok, so this is not a VB.NET question.  I can throw all that stuff out the window then.

Do you have an ActiveX container, such as VB6 form?  You need to be able to test if you can place this control in the container.

I haven't seen anyone talking about doing what you are doing, but that doesn't mean that I don't understand.

Bob

0
 

Author Comment

by:gerard_odonnell
ID: 12240867
I can use the control in a container but not from Windows Script Host.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 12241014
That means that this control needs to be sited on a valid ActiveX container, and cannot be instantiated otherwise.

Bob
0
 

Author Comment

by:gerard_odonnell
ID: 12241783
Is there any way to determine from the type library whether this is the case?
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 375 total points
ID: 12241928
No, but if you try to dimension a new variable in VB6, the Diff, Viewer, and VisMerge classes are not available.  

You can place the control on a site, but you can't instantiate one, and I don't think that I know of any way around that one.

Bob
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Loops Section Overview
Suggested Courses

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