Compartilhar via


IVsMenuEditorSite.CreateItem Method

The host is responsible for giving the menu a unique name, and providing back to IVsMenuEditor a valid IVsMenuItem*. As in IVsMenuEditor::AddItem, both IMIParent and pIMIInsertAfter can be NULL.

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

Syntax

'Declaration
Function CreateItem ( _
    pIMIParent As IVsMenuItem, _
    pIMIInsertAfter As IVsMenuItem, _
    <OutAttribute> ByRef ppIMINew As IVsMenuItem _
) As Integer
int CreateItem(
    IVsMenuItem pIMIParent,
    IVsMenuItem pIMIInsertAfter,
    out IVsMenuItem ppIMINew
)
int CreateItem(
    [InAttribute] IVsMenuItem^ pIMIParent, 
    [InAttribute] IVsMenuItem^ pIMIInsertAfter, 
    [OutAttribute] IVsMenuItem^% ppIMINew
)
abstract CreateItem : 
        pIMIParent:IVsMenuItem * 
        pIMIInsertAfter:IVsMenuItem * 
        ppIMINew:IVsMenuItem byref -> int
function CreateItem(
    pIMIParent : IVsMenuItem, 
    pIMIInsertAfter : IVsMenuItem, 
    ppIMINew : IVsMenuItem
) : int

Parameters

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:

[C++]

HRESULT IVsMenuEditorSite::CreateItem(
   [in]IVsMenuItem *pIMIParent, 
   [in]IVsMenuItem *pIMIInsertAfter, 
   [out]IVsMenuItem **ppIMINew
);

.NET Framework Security

See Also

Reference

IVsMenuEditorSite Interface

Microsoft.VisualStudio.Shell.Interop Namespace