다음을 통해 공유


IVsSolution.GenerateUniqueProjectName(String, String) Method

Definition

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

public:
 int GenerateUniqueProjectName(System::String ^ lpszRoot, [Runtime::InteropServices::Out] System::String ^ % pbstrProjectName);
int GenerateUniqueProjectName(std::wstring const & lpszRoot, [Runtime::InteropServices::Out] std::wstring const & & pbstrProjectName);
public int GenerateUniqueProjectName (string lpszRoot, out string pbstrProjectName);
abstract member GenerateUniqueProjectName : string * string -> int
Public Function GenerateUniqueProjectName (lpszRoot As String, ByRef pbstrProjectName As String) As Integer

Parameters

lpszRoot
String

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

pbstrProjectName
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.

Returns

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

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsSolution::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.

Applies to