This documentation is archived and is not being maintained.

SccDiff Function

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

This function displays (or optionally just checks for) the differences between the current file (on the local disk) and its last checked-in version in the source control system.

   LPVOID    pvContext,
   HWND      hWnd,
   LPCSTR    lpFileName,
   LONG      fOptions,
   LPCMDOPTS pvOptions



[in] The source control plug-in context structure.


[in] A handle to the IDE window that the source control plug-in can use as a parent for any dialog boxes that it provides.


[in] File name for which the difference is requested.


[in] Command flags. See Remarks for details.


[in] Source control plug-in-specific options.

The source control plug-in implementation of this function is expected to return one of the following values:

Value Description


The working copy and server version are identical.


The working copy differs from the version under source control.


A file or project needs to be reloaded.


The file is not under source control.


The user is not allowed to perform this operation.


There was a problem accessing the source control system, probably due to network or contention issues. A retry is recommended.


Nonspecific failure; file difference was not obtained.


The local file was not found.

This function serves two different purposes. By default, it displays a list of changes to a file. The source control plug-in opens its own window, in whatever format it chooses, to display the differences between the user's file on disk and the latest version of the file under source control.

Alternatively, the IDE may simply need to determine whether a file has changed. For example, the IDE may need to determine whether it is safe to check out a file without informing the user. In that case, the IDE passes in the SCC_DIFF_CONTENTS flag. The source control plug-in must check the file on disk, byte by byte, against the source-controlled file and return a value indicating whether the two files are different without displaying anything to the user.

As a performance optimization, the source control plug-in may use an alternative based on a checksum or a timestamp instead of the byte-by-byte comparison called for by SCC_DIFF_CONTENTS: these forms of comparison are obviously faster but less reliable. Not all source control systems may support these alternative comparison methods, and the plug-in may have to fall back to a contents comparison. All source control plug-ins must, at a minimum, support a contents comparison.


The quick difference flags are mutually exclusive. It is valid to pass no flags, but it is not valid to simultaneously pass more than one. SCC_DIFF_QUICK_DIFF, which is a mask that combines all flags, can be used to test, but it should never be passed as a parameter.

fOption Meaning


Case-insensitive comparison (may be used for either quick or visual difference).


Ignores white space (may be used for either quick or visual difference).


Silently compares the file, byte by byte.


Silently compares the file via a checksum when supported. If not supported, falls back to a comparison of contents.


Silently compares the file via its timestamp when supported. If not supported, falls back to a comparison of contents.