This function prompts the user for a project path, which is a string that is meaningful only to the source control plug-in. It is called when the user is:
Creating a new project
Adding an existing project to version control
Attempting to find an existing version control project
The source control plug-in implementation of this function is expected to return one of the following values:
The project was successfully created or retrieved.
The operation was canceled.
There was a problem accessing the source control system, probably due to network or contention issues.
There was a problem trying to connect to the source control system.
An unspecified error occurred.
The purpose of this function is for the IDE to acquire the parameters lpProjName and lpAuxProjPath. After the source control plug-in prompts the user for this information, it passes these two strings back to the IDE. The IDE persists these strings in its solution file and passes them to the SccOpenProject Function whenever the user opens this project. These strings enable the plug-in to track information associated with a project.
When the function is first called, lpAuxProjPath is set to an empty string. lProjName may also be empty, or it may contain the IDE project name, which the source control plug-in may use or ignore. When the function successfully returns, the plug-in returns the two corresponding strings. The IDE makes no assumptions about these strings, will not use them, and will not allow the user to modify them. If the user wants to change the settings, the IDE will call SccGetProjPath again, passing in the same values it had received the previous time. This gives the plug-in complete control over these two strings.
For lpUser, the IDE may pass in a user name, or it may simply pass in a pointer to an empty string. If there is a user name, the source control plug-in should use it as a default. However, if no name was passed or if the login failed with the given name, the plug-in should prompt the user for a login and pass the name back in lpUser when it receives a valid login. Because the plug-in may change this string, the IDE will always allocate a buffer of size (SCC_USER_LEN+1).
The first action that the IDE performs may be a call to either the SccOpenProject function or the SccGetProjPath function. Hence, both of them have an identical lpUser parameter, which enables the source control plug-in to log the user in at either time. Even if the return from the function indicates a failure, the plug-in must fill this string with a valid login name.
lpLocalPath is the directory where the user keeps the project. It may be an empty string. If there is no directory currently defined (as in the case of a user attempting to download a project from the source control system) and if bAllowChangePath is TRUE, the source control plug-in can prompt the user for input or use some other method to place its own string into lpLocalPath. If bAllowChangePath is FALSE, the plug-in should not change the string, because the user is already working in the specified directory.
If the user creates a new project to be put under source control, the source control plug-in might not actually create it in the source control system at the time SccGetProjPath is called. Instead, it passes back the string along with a nonzero value for pbNew, indicating that the project will be created in the source control system.
For example, if a user in the New Project wizard in Visual Studio adds his or her project to source control, Visual Studio calls this function, and the plug-in determines if it is okay to create a new project in the source control system to contain the Visual Studio project. If the user clicks Cancel before completing the wizard, the project is never created. If the user clicks OK, Visual Studio calls SccOpenProject, passing in SCC_OPT_CREATEIFNEW, and the source controlled project is created at that time.