'Diff Doc' ActiveX Interface

The Comprehensive Document Comparison Tool

COM-ActiveX Interface for 'Diff Doc'

For COM+ (i.e. with IIS) users click here.

One very important note is that the file, DiffDoc.EXE is both an executable application AND an ActiveX component.  Again, the file DiffDoc.EXE, can be ran as a stand alone application, and can be referenced as a component within your development environment. There is only one installation for 'Diff Doc'. DiffDoc.exe is installed in the Program Files folder of your operating system.

 

Directly below is some VBS (Visual Basic Script). You could put the following 3 lines in a text file, call it TEST.VBS and give it a go:

set DiffApp = WScript.CreateObject("DiffDoc.clsDiffDoc")
result = DiffApp.DoCommandLine("/SC:\IN\Tryme.txt /MC:\IN\Tryme2.txt /X /V")
MsgBox(result)



For Visual Basic users, simply make a reference to the DiffDoc.EXE application in the Tools\References menu item. Once done you now have access to the DiffDoc component.
Here is some sample code illustrating its usage:

Click here to download the VB6 demo .

Click here to download the VB.NET demo.


Below is some sample code using Visual Basic:

Private Sub Command1_Click()
Dim dd As DiffDoc.clsDiffDoc

Set dd = New DiffDoc.clsDiffDoc
dd.Key = "" ' Assign Key To the 'Final Key', given upon registration.

' Run by the command line. See 'Diff Doc' documentation for a full listing of
' switches and options.
lRetVal = dd.DoCommandLine("/SE:\Delme\Test1.txt /ME:\Delme\Test2.txt /TE:\Delme\ReportOut.DOC /F1 /R4 /X ")

' DoCommandLine() Return Values
' 0 = Success
' -1 = Shareware expired
' -2 = Command line string empty or invalid.
' -3 = Missing required command line argument(s)

If (lRetVal = 0 And dd.NumDifferencesFound > 0) Then
Call ShellExecuteAny(Me.hwnd, "open", "E:\Delme\ReportOut.DOC", ByVal 0&, ByVal 0&, 4)
End If

Set dd = Nothing ' Closes 'Diff Doc' application
End Sub

As you can see from the code above, the ActiveX simply wraps the command line feature. So, to learn what you can do with the ActiveX, please refer to the 'Using the Command Line' section of the 'Diff Doc' users manual

 

METHODS

     DoCommandLine()
     DESCRIPTION:

      This function emulates doing the command line, but through the COM interface.

      RETURN VALUES:
         0 = Success
        -1 = Shareware expired
        -2 = Command line String empty or invalid
        -3 = Missing required command line argument(s)
 

PROPERITES

     NumDifferencesFound
     DESCRIPTION:
       Returns the number of differences found while doing a comparison of files or folders.

 

EVENTS

     OnError(lErrorNumber As Long, sErrorString As String)
     DESCRIPTION:

      When an error occurs this event is triggered supplying both the error code and description.  This can be very helpful while troubleshooting and developing.