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")
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 .
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)
Set dd = Nothing ' Closes 'Diff Doc' application
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.
This function emulates
doing the command line, but through the COM interface.
0 = Success
-1 = Shareware expired
-2 = Command line String empty or invalid
-3 = Missing required command line argument(s)
Returns the number of differences found while doing a comparison of files or folders.
OnError(lErrorNumber As Long, sErrorString As String)
When an error occurs this event is triggered supplying both the error code and description. This can be very helpful while troubleshooting and developing.