IVsSolution2::GenerateUniqueProjectName Method (String^, String^)

 

Generates a unique project name, given a root project name.

Namespace:   Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)

int GenerateUniqueProjectName(
	String^ lpszRoot,
	[OutAttribute] String^% pbstrProjectName
)

Parameters

lpszRoot
Type: System::String^

[in] Root project name. Passing in null causes the environment to use an appropriate default value for the name, like Project.

pbstrProjectName
Type: System::String^

[out] Pointer to the project name based on the root project name specified in the lpszRoot parameter. This value is unique within the solution.

Return Value

Type: System::Int32

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

From vsshell.idl:

HRESULT IVsSolution2::GenerateUniqueProjectName(
   [in] LPCOLESTR lpszRoot, 
   [out] BSTR *pbstrProjectName
);

This method is typically called by wizards. When you call the CreateProject method to create a project, the environment handles creating a unique project name through the New Project dialog box.

Return to top
Show: