IComparison Interface

This interface provides access to properties and methods that are common to comparisons and is implemented by the TextComparison Object, BinaryComparison Object, ImageComparison Object, and FolderComparison Object.

Properties

ViewTyperead/writeIComparison

The comparison type (two way or three way layout).

IDL [propget] HRESULT ViewType([out, retval] FileViewType* pValue)
[propput] HRESULT ViewType([in] FileViewType newValue)
.NET FileViewType ViewType[get, set]

Methods

CompareIComparison

Compares two or three files. This method is synchronous. An event ComparisonComplete is fired when the comparison is finished to report errors and results.

IDL HRESULT Compare(
    [in] VARIANT strFirstFile,
    [in] VARIANT strSecondFile,
    [in, optional] VARIANT strThirdFile)
.NET void Compare(
    Object strFirstFile,
    Object strSecondFile,
    Object strThirdFile)
  • strFirstFile
    The fully qualified path to the first file
  • strSecondFile
    The fully qualified path to the second file
  • strThirdFile optional
    The fully qualified path to the third file

PrintIComparison

Prints the file comparison.

IDL HRESULT Print(
    [in] VARIANT_BOOL bShowPrinterDialog,
    [in] PageOrientation nOrientation)
.NET void Print(
    Boolean bShowPrinterDialog,
    PageOrientation nOrientation)
  • bShowPrinterDialog
    Defaults to FALSE. Whether to show the printer dialog to the user before printing.
  • nOrientation
    Defaults to poLandscape. Whether to print in portrait or landscape mode.

RefreshIComparison

Recompares the files displayed in the window. This will cause any unsaved changes to be discarded.

IDL HRESULT Refresh()
.NET void Refresh()

ReportIComparison

Generates a report for the file comparison.

IDL HRESULT Report(
    [in] BSTR bstrReporter,
    [in] LineEndingStyle nLineEndingStyle,
    [in] BSTR strOutputFile)
.NET void Report(
    String bstrReporter,
    LineEndingStyle nLineEndingStyle,
    String strOutputFile)
  • bstrReporter
    The short-name of the reporter that should be used to generate the report. Valid names are “xml”, “html”, “htmlslideshow”, and “diff”. Please note that not all reporters support the generation of three-way comparison reports.
  • nLineEndingStyle
    The type of line-ending to use in the generated report file(s).
  • strOutputFile
    The name of the output file for the report. If the reporter generates more than one file, those files will have names based on this one.

Report2IComparison

Generates a report for the file comparison.

IDL HRESULT Report2(
    [in] BSTR bstrReporter,
    [in] LineEndingStyle nLineEndingStyle,
    [in] VARIANT vtEncoding,
    [in] BSTR strOutputFile)
.NET void Report2(
    String bstrReporter,
    LineEndingStyle nLineEndingStyle,
    Object vtEncoding,
    String strOutputFile)
  • bstrReporter
    The short-name of the reporter that should be used to generate the report. Valid names are “xml”, “html”, “htmlslideshow”, and “diff”. Please note that not all reporters support the generation of three-way comparison reports.
  • nLineEndingStyle
    The type of line-ending to use in the generated report file(s).
  • vtEncoding
    The character encoding to use for the generated report. It can either be a code page number, or one of the following strings: ‘UCS2’ (Unicode UCS2), ‘UCS2-BE’ (Unicode UCS2 big endian), ‘UTF8’ (Unicode UTF8 with byte-order marker), ‘UTF8-NOBOM’ (Unicode UTF8 without byte-order marker), ‘UTF7’ (Unicode UTF7).
  • strOutputFile
    The name of the output file for the report. If the reporter generates more than one file, those files will have names based on this one.

SaveComparisonIComparison

Saves the comparison to a file. We recommend that you use the .cmp7 extension in the filename.

IDL HRESULT SaveComparison(
    [in] BSTR filename)
.NET void SaveComparison(
    String filename)
  • filename
    The name of the file to which the comparison should be saved.

SetPanelTitlesIComparison

Sets the titles shown above the file panels.

IDL HRESULT SetPanelTitles(
    [in] VARIANT strFirst,
    [in] VARIANT strSecond,
    [in, optional] VARIANT strThird)
.NET void SetPanelTitles(
    Object strFirst,
    Object strSecond,
    Object strThird)
  • strFirst
    The title for the first file panel.
  • strSecond
    The title for the second file panel.
  • strThird optional
    The title for the third file panel.