IVsSolution2.GenerateUniqueProjectName Method

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)

Syntax

'Declaration
Function GenerateUniqueProjectName ( _
    lpszRoot As String, _
    <OutAttribute> ByRef pbstrProjectName As String _
) As Integer
int GenerateUniqueProjectName(
    string lpszRoot,
    out string pbstrProjectName
)
int GenerateUniqueProjectName(
    [InAttribute] String^ lpszRoot, 
    [OutAttribute] String^% pbstrProjectName
)
abstract GenerateUniqueProjectName : 
        lpszRoot:string * 
        pbstrProjectName:string byref -> int
function GenerateUniqueProjectName(
    lpszRoot : String, 
    pbstrProjectName : String
) : int

Parameters

  • lpszRoot
    Type: System.String

    [in] Root project name. Passing in nulla null reference (Nothing in Visual Basic) 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.

Remarks

COM Signature

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.

.NET Framework Security

See Also

Reference

IVsSolution2 Interface

Microsoft.VisualStudio.Shell.Interop Namespace