Compartilhar via


IVsAddProjectItemDlg2.AddNewProjectItem Method

Adds a new project item.

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

Syntax

'Declaration
Function AddNewProjectItem ( _
    itemidLoc As UInteger, _
    ByRef rguidProject As Guid, _
    pProject As IVsProject, _
    grfEditorFlags As UInteger, _
    ByRef rguidEditorType As Guid, _
    pszPhysicalView As String, _
    ByRef rguidLogicalView As Guid, _
    pszItemName As String, _
    <OutAttribute> ByRef pbstrFileToAdd As String _
) As Integer
int AddNewProjectItem(
    uint itemidLoc,
    ref Guid rguidProject,
    IVsProject pProject,
    uint grfEditorFlags,
    ref Guid rguidEditorType,
    string pszPhysicalView,
    ref Guid rguidLogicalView,
    string pszItemName,
    out string pbstrFileToAdd
)
int AddNewProjectItem(
    [InAttribute] unsigned int itemidLoc, 
    [InAttribute] Guid% rguidProject, 
    [InAttribute] IVsProject^ pProject, 
    [InAttribute] unsigned int grfEditorFlags, 
    [InAttribute] Guid% rguidEditorType, 
    [InAttribute] String^ pszPhysicalView, 
    [InAttribute] Guid% rguidLogicalView, 
    [InAttribute] String^ pszItemName, 
    [InAttribute] [OutAttribute] String^% pbstrFileToAdd
)
abstract AddNewProjectItem : 
        itemidLoc:uint32 * 
        rguidProject:Guid byref * 
        pProject:IVsProject * 
        grfEditorFlags:uint32 * 
        rguidEditorType:Guid byref * 
        pszPhysicalView:string * 
        rguidLogicalView:Guid byref * 
        pszItemName:string * 
        pbstrFileToAdd:string byref -> int
function AddNewProjectItem(
    itemidLoc : uint, 
    rguidProject : Guid, 
    pProject : IVsProject, 
    grfEditorFlags : uint, 
    rguidEditorType : Guid, 
    pszPhysicalView : String, 
    rguidLogicalView : Guid, 
    pszItemName : String, 
    pbstrFileToAdd : String
) : int

Parameters

  • itemidLoc
    Type: UInt32

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

  • rguidProject
    Type: Guid%

    [in] Unique identifier of the project.

  • rguidEditorType
    Type: Guid%

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

  • pszPhysicalView
    Type: String

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

  • rguidLogicalView
    Type: Guid%

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

  • pszItemName
    Type: String

    [in] Template file name.

  • pbstrFileToAdd
    Type: String%

    [in, out] File name to add.

Return Value

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

Remarks

COM Signature

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
);

.NET Framework Security

See Also

Reference

IVsAddProjectItemDlg2 Interface

Microsoft.VisualStudio.Shell.Interop Namespace