SccAdd Function

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at SccAdd Function.

This function adds new files to the source control system.

SCCRTN SccAdd(  
   LPVOID    pvContext,  
   HWND      hWnd,  
   LONG      nFiles,  
   LPCSTR*   lpFileNames,  
   LPCSTR    lpComment,  
   LONG*     pfOptions,  
   LPCMDOPTS pvOptions  
);  

Parameters

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

hWnd
[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.

nFiles
[in] Number of files selected to be added to the current project as given in the lpFileNames array.

lpFileNames
[in] Array of fully qualified local names of files to be added.

lpComment
[in] The comment to be applied to all of the files being added.

pfOptions
[in] Array of command flags, provided on a per-file basis.

pvOptions
[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:

ValueDescription
SCC_OKThe add operation was successful.
SCC_E_FILEALREADYEXISTSThe selected file is already under source control.
SCC_E_TYPENOTSUPPORTEDThe type of the file (for example, binary) is not supported by the source control system.
SCC_E_OPNOTSUPPORTEDThe source control system does not support this operation.
SCC_E_ACCESSFAILUREThere was a problem accessing the source control system, probably due to network or contention issues. A retry is recommended.
SCC_E_NOTAUTHORIZEDThe user is not allowed to perform this operation.
SCC_E_NONSPECIFICERRORNonspecific failure; add not performed.
SCC_I_OPERATIONCANCELEDThe operation was cancelled before completion.
SCC_I_RELOADFILEA file or project needs to be reloaded.
SCC_E_FILENOTEXISTLocal file was not found.

The usual fOptions are replaced here by an array, pfOptions, with one LONG option specification per file. This is because the file type may vary from file to file.

System_CAPS_ICON_note.jpg Note

It is invalid to specify both SCC_FILETYPE_TEXT and SCC_FILETYPE_BINARY options for the same file, but it is valid to specify neither. Setting neither is the same as setting SCC_FILETYPE_AUTO, in which case the source control plug-in autodetects the file type.

Below is the list of flags used in the pfOptions array:

OptionValueMeaning
SCC_FILETYPE_AUTO0x00The source control plug-in should detect the file type.
SCC_FILETYPE_TEXT0x01Indicates an ASCII text file.
SCC_FILETYPE_BINARY0x02Indicates a file type other than ASCII text.
SCC_ADD_STORELATEST0x04Stores only the latest copy of the file, no deltas.
SCC_FILETYPE_TEXT_ANSI0x08Treats the file as ANSI text.
SCC_FILETYPE_UTF80x10Treats the file as Unicode text in UTF8 format.
SCC_FILETYPE_UTF16LE0x20Treats the file as Unicode text in UTF16 Little Endian format.
SCC_FILETYPE_UTF16BE0x40Treats the file as Unicode text in UTF16 Big Endian format.

Source Control Plug-in API Functions

Show: