Freigeben über


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
'Usage
Dim instance As IVsAddProjectItemDlg2
Dim itemidLoc As UInteger
Dim rguidProject As Guid
Dim pProject As IVsProject
Dim grfEditorFlags As UInteger
Dim rguidEditorType As Guid
Dim pszPhysicalView As String
Dim rguidLogicalView As Guid
Dim pszItemName As String
Dim pbstrFileToAdd As String
Dim returnValue As Integer

returnValue = instance.AddNewProjectItem(itemidLoc, _
    rguidProject, pProject, grfEditorFlags, _
    rguidEditorType, pszPhysicalView, _
    rguidLogicalView, pszItemName, pbstrFileToAdd)
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: 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.
  • 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).
  • 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.

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

IVsAddProjectItemDlg2 Members

Microsoft.VisualStudio.Shell.Interop Namespace