Export (0) Print
Expand All

IVsProjectFactory.CreateProject Method

Creates a new project.

Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop (in microsoft.visualstudio.shell.interop.dll)

int CreateProject (
	[InAttribute] string pszFilename,
	[InAttribute] string pszLocation,
	[InAttribute] string pszName,
	[InAttribute] uint grfCreateFlags,
	[InAttribute] ref Guid iidProject,
	out IntPtr ppvProject,
	out int pfCanceled
)
int CreateProject (
	/** @attribute InAttribute() */ String pszFilename, 
	/** @attribute InAttribute() */ String pszLocation, 
	/** @attribute InAttribute() */ String pszName, 
	/** @attribute InAttribute() */ UInt32 grfCreateFlags, 
	/** @attribute InAttribute() */ /** @ref */ Guid iidProject, 
	/** @attribute OutAttribute() */ /** @ref */ IntPtr ppvProject, 
	/** @attribute OutAttribute() */ /** @ref */ int pfCanceled
)
JScript does not support passing value-type arguments by reference.

Parameters

pszFilename

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

pszLocation

[in] Location where the project will be created.

pszName

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

grfCreateFlags

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

iidProject

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

ppvProject

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

pfCanceled

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

Return Value

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

COM Signature

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). See Managed Visual Studio Project Sample and Basic Project Sample samples for examples. The environment uses the file extension to determine the VSPackage on which to call this method.

Community Additions

ADD
Show:
© 2014 Microsoft