IVsProjectFactory.CreateProject Method (String, String, String, UInt32, Guid, IntPtr, Int32)


Creates a new project.

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

abstract CreateProject : 
        pszFilename:string *
        pszLocation:string *
        pszName:string *
        grfCreateFlags:uint32 *
        iidProject:Guid byref *
        ppvProject:nativeint byref *
        pfCanceled:int byref -> int


Type: System.String

[in] File name of the project that will be created.

Type: System.String

[in] Location where the project will be created.

Type: System.String

[in] If applicable, the name of the template to use when cloning a new project.

Type: System.UInt32

[in] Set of flag values taken from the __VSCREATEPROJFLAGS enumeration.

Type: System.Guid

[in] Identifier of the interface that the caller wants returned.

Type: System.IntPtr

[out, iid_is(iidProject)] Pointer to the interface specified by iidProject.

Type: System.Int32

[out] Returns true if the user presses the Cancel button to abort the creation of this project. Otherwise, it is false.

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 IVsProjectFactory::CreateProject(
   [in] LPCOLESTR pszFilename,
   [in] LPCOLESTR pszLocation,
   [in] LPCOLESTR pszName,
   [in] VSCREATEPROJFLAGS grfCreateFlags,
   [in] REFIID iidProject,
   [out, iid_is(iidProject)] void **ppvProject,
   [out] BOOL *pfCanceled

CreateProject is called by the shell when a user tries to create a new project.

Create a new project by cloning an existing template project (which could be empty). The environment uses the file extension to determine the VSPackage on which to call this method.

Return to top