IVsAddProjectItemDlg2::AddNewProjectItem Method (UInt32, Guid, IVsProject^, UInt32, Guid, String^, Guid, String^, String^)

 

Adds a new project item.

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

int AddNewProjectItem(
	unsigned int itemidLoc,
	[InAttribute] Guid% rguidProject,
	IVsProject^ pProject,
	unsigned int grfEditorFlags,
	[InAttribute] Guid% rguidEditorType,
	String^ pszPhysicalView,
	[InAttribute] Guid% rguidLogicalView,
	String^ pszItemName,
	String^% pbstrFileToAdd
)

Parameters

itemidLoc
Type: System::UInt32

[in] Item identifier of the folder in the project to which items should be added.

rguidProject
Type: System::Guid

[in] Unique identifier of the project.

pProject
Type: Microsoft.VisualStudio.Shell.Interop::IVsProject^

[in] Pointer to the IVsProject3 interface on which the Add Item will be called.

grfEditorFlags
Type: System::UInt32

[in] Flags whose values are taken from the __VSSPECIFICEDITORFLAGS enumeration.

rguidEditorType
Type: System::Guid

[in] Editor type with which to open (if supported).

pszPhysicalView
Type: System::String^

[in] Physical view with which to open (if supported).

rguidLogicalView
Type: System::Guid

[in] Logical view with which to open (if supported).

pszItemName
Type: System::String^

[in] Template file name.

pbstrFileToAdd
Type: System::String^

[in, out] File name to add.

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 IVsAddProjectItemDlg2::AddNewProjectItem(
   [in] VSITEMID itemidLoc,
   [in] REFGUID rguidProject,
   [in] IVsProject *pProject,
   [in] VSSPECIFICEDITORFLAGS grfEditorFlags,
   [in] REFGUID rguidEditorType,
   [in] LPCOLESTR pszPhysicalView,
   [in] REFGUID rguidLogicalView,
   [in] LPCOLESTR pszItemName,
   [in,out] BSTR *pbstrFileToAdd
);
Return to top
Show: