Partager via


IVsProject3.AddItemWithSpecific Method

Adds an item using a specific editor.

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

Syntax

'Declaration
Function AddItemWithSpecific ( _
    itemidLoc As UInteger, _
    dwAddItemOperation As VSADDITEMOPERATION, _
    pszItemName As String, _
    cFilesToOpen As UInteger, _
    rgpszFilesToOpen As String(), _
    hwndDlgOwner As IntPtr, _
    grfEditorFlags As UInteger, _
    ByRef rguidEditorType As Guid, _
    pszPhysicalView As String, _
    ByRef rguidLogicalView As Guid, _
    <OutAttribute> pResult As VSADDRESULT() _
) As Integer
int AddItemWithSpecific(
    uint itemidLoc,
    VSADDITEMOPERATION dwAddItemOperation,
    string pszItemName,
    uint cFilesToOpen,
    string[] rgpszFilesToOpen,
    IntPtr hwndDlgOwner,
    uint grfEditorFlags,
    ref Guid rguidEditorType,
    string pszPhysicalView,
    ref Guid rguidLogicalView,
    VSADDRESULT[] pResult
)
int AddItemWithSpecific(
    [InAttribute] unsigned int itemidLoc, 
    [InAttribute] VSADDITEMOPERATION dwAddItemOperation, 
    [InAttribute] String^ pszItemName, 
    [InAttribute] unsigned int cFilesToOpen, 
    [InAttribute] array<String^>^ rgpszFilesToOpen, 
    [InAttribute] IntPtr hwndDlgOwner, 
    [InAttribute] unsigned int grfEditorFlags, 
    [InAttribute] Guid% rguidEditorType, 
    [InAttribute] String^ pszPhysicalView, 
    [InAttribute] Guid% rguidLogicalView, 
    [OutAttribute] array<VSADDRESULT>^ pResult
)
abstract AddItemWithSpecific : 
        itemidLoc:uint32 * 
        dwAddItemOperation:VSADDITEMOPERATION * 
        pszItemName:string * 
        cFilesToOpen:uint32 * 
        rgpszFilesToOpen:string[] * 
        hwndDlgOwner:IntPtr * 
        grfEditorFlags:uint32 * 
        rguidEditorType:Guid byref * 
        pszPhysicalView:string * 
        rguidLogicalView:Guid byref * 
        pResult:VSADDRESULT[] byref -> int
function AddItemWithSpecific(
    itemidLoc : uint, 
    dwAddItemOperation : VSADDITEMOPERATION, 
    pszItemName : String, 
    cFilesToOpen : uint, 
    rgpszFilesToOpen : String[], 
    hwndDlgOwner : IntPtr, 
    grfEditorFlags : uint, 
    rguidEditorType : Guid, 
    pszPhysicalView : String, 
    rguidLogicalView : Guid, 
    pResult : VSADDRESULT[]
) : int

Parameters

  • itemidLoc
    Type: UInt32

    [in] Item identifier of the item to add. Values are taken from the VSITEMIDDWORD.

  • pszItemName
    Type: String

    [in] Name of the item to be added.

  • cFilesToOpen
    Type: UInt32

    [in] Number of files to open.

  • rgpszFilesToOpen
    Type: array<String[]

    [in, size_is(cFilesToOpen)] Actual number of files passed in with cFilesToOpen.

  • hwndDlgOwner
    Type: IntPtr

    [in] Handle to the dialog box.

  • rguidEditorType
    Type: Guid%

    [in] Unique identifier of the editor type.

  • pszPhysicalView
    Type: String

    [in] Name of physical view.

  • rguidLogicalView
    Type: Guid%

    [in] Name of the logical view.

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 IVsProject3::AddItemWithSpecific(
   [in] VSITEMID itemidLoc,
   [in] VSADDITEMOPERATION dwAddItemOperation,
   [in] LPCOLESTR pszItemName,
   [in] ULONG cFilesToOpen,
   [in, size_is(cFilesToOpen)] LPCOLESTR rgpszFilesToOpen[],
   [in] HWND hwndDlgOwner,
   [in] VSSPECIFICEDITORFLAGS grfEditorFlags,
   [in] REFGUID rguidEditorType,
   [in] LPCOLESTR pszPhysicalView,
   [in] REFGUID rguidLogicalView,
   [out, retval] VSADDRESULT *pResult
);

This method is used to add item(s) to the project and additionally to ask the project to open the item using the specified editor information. It is an extension of AddItem.

Implemented in conjunction with OpenSpecificEditor.

.NET Framework Security

See Also

Reference

IVsProject3 Interface

Microsoft.VisualStudio.Shell.Interop Namespace