SccAddFromScc 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 SccAddFromScc Function.
This function allows the user to browse for files that are already in the source control system and subsequently make those files part of the current project. For example, this function can get a common header file into the current project without copying the file. The return array of files, lplpFileNames, contains the list of files that the user wants to add to the IDE project.
SCCRTN SccAddFromScc ( LPVOID pvContext, HWND hWnd, LPLONG lpnFiles, LPCSTR** lplpFileNames );
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.
lpnFiles
[in, out] A buffer for the number of files that are being added in. (This is NULL if the memory pointed to by lplpFileNames is to be released. See Remarks for details.)
lplpFileNames
[in, out] An array of pointers to all the file names without directory paths. This array is allocated and freed by the source control plug-in. If lpnFiles = 1 and lplpFileNames is not NULL, the first name in the array pointed to by lplpFileNames contains the destination folder.
The source control plug-in implementation of this function is expected to return one of the following values:
| Value | Description |
|---|---|
| SCC_OK | The files were successfully located and added to the project. |
| SCC_I_OPERATIONCANCELED | Operation was canceled with no effect. |
| SCC_I_RELOADFILE | A file or project needs to be reloaded. |
The IDE calls this function. If the source control plug-in supports specifying a local destination folder, the IDE passes lpnFiles = 1 and passes the local folder name into lplpFileNames.
When the call to the SccAddFromScc function returns, the plug-in has assigned values to lpnFiles and lplpFileNames, allocating the memory for the file name array as necessary (note that this allocation replaces the pointer in lplpFileNames). The source control plug-in is responsible for placing all files into the user's directory or in the specified designation folder. The IDE then adds the files to the IDE project.
Finally, the IDE calls this function a second time, passing in NULL for lpnFiles. This is interpreted as a special signal by the source control plug-in to release the memory allocated for the file-name array in lplpFileNames``.
lplpFileNames is a char *** pointer. The source control plug-in places a pointer to an array of pointers to file names, thus passing the list in the standard way for this API.
Initial versions of the VSSCI API did not provide a way to indicate the target project for the added files. To accommodate this, the semantics of the |