BinaryComparison Object
On this page:
- Description
- Properties
- Active read/write, ICommonUI
- AllUnresolvedConflicts read-only, IFileComparison
- AutoSaveOnClose read/write, IFileComparison
- ChangeLength read-only, IBinaryComparison
- ChangeStartLine read-only, IBinaryComparison
- ChangeType read-only, IBinaryComparison
- ComparisonError read-only, IFileComparison
- ComparisonResult read-only, IFileComparison
- ErrorInfo read/write, IFileComparison
- Height read/write, ICommonUI
- Left read/write, ICommonUI
- Maximized read/write, ICommonUI
- Minimized read/write, ICommonUI
- Modified read/write, IFileComparison
- NumberOfBytes read-only, IBinaryComparison
- NumberOfChanges read-only, IFileComparison
- PromptForUnsavedFiles read/write, IFileComparison
- ReadOnly read/write, IFileComparison
- SaveFileName read/write, IFileComparison
- ThreeWayMergeActions read-only, IFileComparison
- Top read/write, ICommonUI
- UnresolvedConflicts read-only, IFileComparison
- ViewType read/write, IComparison
- Visible read/write, ICommonUI
- Width read/write, ICommonUI
- Methods
- Close ICommonUI
- Compare IComparison
- CompareAsync IFileComparison
- GiveUserControl ICommonUI
- Print IComparison
- Refresh IComparison
- Report IComparison
- Report2 IComparison
- Restore ICommonUI
- SaveComparison IComparison
- SaveFile IFileComparison
- SaveFileAs IFileComparison
- SetPanelTitles IComparison
- ThreeWayMerge IFileComparison
- Events
Description
This object represents a binary file comparison window. The window isn’t necessarily visible on screen and can be used either to perform file comparison services for a client, or to present file comparisons on the screen to the user.
Use the methods and properties exposed by this object to perform binary file comparisons, and to alter the appearance of a binary file comparison window.
Once the comparison represented by this object is closed, the handler for the Close event provides the final opportunity to access methods and properties. Accessing them after this time will result in an error.
Properties
Active read/write, ICommonUI
The active state of the comparison window.
IDL |
[propget] HRESULT Active([out, retval] VARIANT_BOOL* pValue)
|
---|---|
.NET | Boolean Active[get, set] |
AllUnresolvedConflicts read-only, IFileComparison
Not currently used.
AutoSaveOnClose read/write, IFileComparison
Not currently used.
ChangeLength read-only, IBinaryComparison
The number of lines in a change.
IDL |
[propget] HRESULT ChangeLength(
|
---|---|
.NET | Int32
get_ChangeLength( |
nChange
Specifies the change (0 based) for which the number of contained bytes is required. This value should be in the range 0 toNumberOfChanges-1
.nSide
Specifies the left (0) or right (1) side of the change.nFilePair
optional
Specifies whether to return results for files 0 and 1 (whennFilePair = 0
, the default) or files 1 and 2 (whennFilePair = 1
).
ChangeStartLine read-only, IBinaryComparison
The starting byte offset (0 based) of a change.
IDL |
[propget] HRESULT ChangeStartLine(
|
---|---|
.NET | Int32
get_ChangeStartLine( |
nChange
Specifies the change (0 based) for which the starting byte offset is required. This value should be in the range 0 toNumberOfChanges_-1
.nSide
Specifies the left (0) or right (1) side of the change.nFilePair
optional
Specifies whether to return results for files 0 and 1 (whennFilePair = 0
, the default) or files 1 and 2 (whennFilePair = 1
).
ChangeType read-only, IBinaryComparison
The type of a change. A change represents a block of inserted, removed, changed, or unchanged lines.
IDL |
[propget] HRESULT ChangeType(
|
---|---|
.NET | ChangeStyle
get_ChangeType( |
nChange
Specifies the change (0 based) for which the type is required. This value should be in the range 0 toNumberOfChanges-1
.nFilePair
optional
Specifies whether to return results for files 0 and 1 (whennFilePair = 0
, default) or files 1 and 2 (whennFilePair = 1
).
ComparisonError read-only, IFileComparison
The error (if any) that was encountered by the Compare
method.
IDL |
[propget] HRESULT ComparisonError(
|
---|---|
.NET | FileComparisonError
get_ComparisonError( |
nFilePair
optional
Specifies whether to return results for files 0 and 1 (whennFilePair = 0
, the default) or files 1 and 2 (whennFilePair = 1
).
ComparisonResult read-only, IFileComparison
The result (fcrSame
, fcrDifferent
, fcrError
) of the comparison performed by the Compare
method.
IDL |
[propget] HRESULT ComparisonResult(
|
---|---|
.NET | FileComparisonResult
get_ComparisonResult( |
nFilePair
optional
Specifies whether to return results for files 0 and 1 (whennFilePair = 0
, the default) or files 1 and 2 (whennFilePair = 1
).
ErrorInfo read/write, IFileComparison
Provides detailed information about errors encountered while loading/comparing one of the files. If nFile
is -1
, then errors that applied to all three files (for example, out of memory errors) are returned.
IDL |
[propget] HRESULT ErrorInfo(
|
---|---|
.NET | String
get_ErrorInfo( |
nFile
The file (0, 1, or 2) to get error information for. A value of-1
can also be specified to denote all files.
Height read/write, ICommonUI
The height of the comparison window in pixels.
IDL |
[propget] HRESULT Height([out, retval] long* pValue)
|
---|---|
.NET | Int32 Height[get, set] |
Left read/write, ICommonUI
The location of the left edge pixel coordinate of the comparison window.
IDL |
[propget] HRESULT Left([out, retval] long* pValue)
|
---|---|
.NET | Int32 Left[get, set] |
Maximized read/write, ICommonUI
The maximized state of the comparison window.
IDL |
[propget] HRESULT Maximized([out, retval] VARIANT_BOOL* pValue)
|
---|---|
.NET | Boolean Maximized[get, set] |
Minimized read/write, ICommonUI
The minimized state of the comparison window.
IDL |
[propget] HRESULT Minimized([out, retval] VARIANT_BOOL* pValue)
|
---|---|
.NET | Boolean Minimized[get, set] |
Modified read/write, IFileComparison
Not currently used.
NumberOfBytes read-only, IBinaryComparison
The number of bytes in one of the compared files.
IDL |
[propget] HRESULT NumberOfBytes(
|
---|---|
.NET | Int16
get_NumberOfBytes( |
nFile
Specifies the file in question (0, 1 or 2 for the first, second and third files respectively).
NumberOfChanges read-only, IFileComparison
The number of changes between two files.
IDL |
[propget] HRESULT NumberOfChanges(
|
---|---|
.NET | Int32
get_NumberOfChanges( |
nFilePair
optional
Specifies whether to return the number of changes between files 0 and 1 (whennFilePair = 0
, the default) or files 1 and 2 (whennFilePair = 1
).
PromptForUnsavedFiles read/write, IFileComparison
Not currently used.
ReadOnly read/write, IFileComparison
Not currently used.
SaveFileName read/write, IFileComparison
Not currently used.
ThreeWayMergeActions read-only, IFileComparison
Not currently used.
Top read/write, ICommonUI
The location of the top edge pixel coordinate of the comparison window.
IDL |
[propget] HRESULT Top([out, retval] long* pValue)
|
---|---|
.NET | Int32 Top[get, set] |
UnresolvedConflicts read-only, IFileComparison
Not currently used.
ViewType read/write, IComparison
The comparison type (two way or three way layout).
IDL |
[propget] HRESULT ViewType([out, retval] FileViewType* pValue)
|
---|---|
.NET | FileViewType ViewType[get, set] |
Visible read/write, ICommonUI
The visible state of the comparison window.
IDL |
[propget] HRESULT Visible([out, retval] VARIANT_BOOL* pValue)
|
---|---|
.NET | Boolean Visible[get, set] |
Width read/write, ICommonUI
The width of the comparison window in pixels.
IDL |
[propget] HRESULT Width([out, retval] long* pValue)
|
---|---|
.NET | Int32 Width[get, set] |
Methods
Close ICommonUI
Closes the comparison window.
IDL |
HRESULT Close()
|
---|---|
.NET | void Close() |
Compare IComparison
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(
|
---|---|
.NET | void Compare( |
strFirstFile
The fully qualified path to the first filestrSecondFile
The fully qualified path to the second filestrThirdFile
optional
The fully qualified path to the third file
CompareAsync IFileComparison
Compares two or three files. This method is asynchronous (returns before the comparison completes). An event ComparisonComplete
is fired when the comparison is finished to report errors and results.
IDL |
HRESULT CompareAsync(
|
---|---|
.NET | void CompareAsync( |
strFirstFile
The fully qualified path to the first filestrSecondFile
The fully qualified path to the second filestrThirdFile
optional
The fully qualified path to the third file
GiveUserControl ICommonUI
Gives control over the lifetime of the comparison window to the user. Merge will not automatically close the window when outstanding automation references are released.
IDL |
HRESULT GiveUserControl()
|
---|---|
.NET | void GiveUserControl() |
Print IComparison
Prints the file comparison.
IDL |
HRESULT Print(
|
---|---|
.NET | void Print( |
bShowPrinterDialog
Defaults to FALSE. Whether to show the printer dialog to the user before printing.nOrientation
Defaults topoLandscape
. Whether to print in portrait or landscape mode.
Refresh IComparison
Recompares the files displayed in the window. This will cause any unsaved changes to be discarded.
IDL |
HRESULT Refresh()
|
---|---|
.NET | void Refresh() |
Report IComparison
Not currently used.
Report2 IComparison
Not currently used.
Restore ICommonUI
Restores the comparison window from minimized or maximised state to its normal resizable state.
IDL |
HRESULT Restore()
|
---|---|
.NET | void Restore() |
SaveComparison IComparison
Saves the comparison to a file. We recommend that you use the .cmp7
extension in the filename.
IDL |
HRESULT SaveComparison(
|
---|---|
.NET | void SaveComparison( |
filename
The name of the file to which the comparison should be saved.
SaveFile IFileComparison
Not currently used.
SaveFileAs IFileComparison
Not currently used.
SetPanelTitles IComparison
Sets the titles shown above the file panels.
IDL |
HRESULT SetPanelTitles(
|
---|---|
.NET | void SetPanelTitles( |
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.
ThreeWayMerge IFileComparison
Not currently used.
Events
Close IFileComparisonEvents
The file comparison window was closed by the user.
IDL |
HRESULT Close()
|
---|---|
.NET | void Close() |
ComparisonComplete IFileComparisonEvents
Occurs when a file comparison completes. For comparisons between two files, only the first two arguments are defined. For comparisons between three files, all four arguments are defined.
IDL |
HRESULT ComparisonComplete(
|
---|---|
.NET | void ComparisonComplete( |
error1
The error, if any, that occurred during the comparison of the first and second files.result1
The result of the comparison between the first and second files.error2
optional
The error, if any, that occurred during the comparison of the second and third files.result2
optional
The result of the comparison between the second and third files.