Compartir a través de


IVsToolWindowFactory.CreateToolWindow Method

Enables the environment to create multiple on-demand tool windows that are implemented by VSPackages.

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

Syntax

'Declaración
Function CreateToolWindow ( _
    ByRef rguidPersistenceSlot As Guid, _
    dwToolWindowId As UInteger _
) As Integer
'Uso
Dim instance As IVsToolWindowFactory
Dim rguidPersistenceSlot As Guid
Dim dwToolWindowId As UInteger
Dim returnValue As Integer

returnValue = instance.CreateToolWindow(rguidPersistenceSlot, _
    dwToolWindowId)
int CreateToolWindow(
    ref Guid rguidPersistenceSlot,
    uint dwToolWindowId
)
int CreateToolWindow(
    [InAttribute] Guid% rguidPersistenceSlot, 
    [InAttribute] unsigned int dwToolWindowId
)
function CreateToolWindow(
    rguidPersistenceSlot : Guid, 
    dwToolWindowId : uint
) : int

Parameters

  • rguidPersistenceSlot
    Type: System.Guid%

    [in] Unique identifier of the tool window.

  • dwToolWindowId
    Type: System.UInt32

    [in] Double word containing the tool window ID.

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 IVsToolWindowFactory::CreateToolWindow(
   [in] REFGUID rguidPersistenceSlot,
   [in] DWORD dwToolWindowId
);

When a VSPackage supports multi-instance tool windows, each window uses the same rguidPersistenceSlot. The dwToolWindowId parameter is used to differentiate between the various instances of the tool window. To create the initial instance of the tool window, call CreateToolWindow from your CreateTool implementation with the dwToolWindowId parameter set to zero. For a sample implementation if this method see the Multi-Instance Tool Window sample.

Permissions

See Also

Reference

IVsToolWindowFactory Interface

IVsToolWindowFactory Members

Microsoft.VisualStudio.Shell.Interop Namespace