Delen via


IVsHasRelatedSaveItems.GetRelatedSaveTreeItems Method

Gets the number of related items to save, or returns a list of related items to save.

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

Syntax

'Declaration
Function GetRelatedSaveTreeItems ( _
    saveItem As VSSAVETREEITEM, _
    celt As UInteger, _
    <OutAttribute> rgSaveTreeItems As VSSAVETREEITEM(), _
    <OutAttribute> ByRef pcActual As UInteger _
) As Integer
int GetRelatedSaveTreeItems(
    VSSAVETREEITEM saveItem,
    uint celt,
    VSSAVETREEITEM[] rgSaveTreeItems,
    out uint pcActual
)
int GetRelatedSaveTreeItems(
    [InAttribute] VSSAVETREEITEM saveItem, 
    [InAttribute] unsigned int celt, 
    [OutAttribute] array<VSSAVETREEITEM>^ rgSaveTreeItems, 
    [OutAttribute] unsigned int% pcActual
)
abstract GetRelatedSaveTreeItems : 
        saveItem:VSSAVETREEITEM * 
        celt:uint32 * 
        rgSaveTreeItems:VSSAVETREEITEM[] byref * 
        pcActual:uint32 byref -> int
function GetRelatedSaveTreeItems(
    saveItem : VSSAVETREEITEM, 
    celt : uint, 
    rgSaveTreeItems : VSSAVETREEITEM[], 
    pcActual : uint
) : int

Parameters

  • celt
    Type: UInt32

    [in] Zero or the number of items in rgSaveTreeItems. See Remarks.

  • pcActual
    Type: UInt32%

    [out] Pointer to an integer that is the number of related items to save or the number of elements in rgSaveTreeItems.

Return Value

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

Remarks

COM Signature

From vsshell80.idl:

HRESULT GetRelatedSaveTreeItems(
    [in] VSSAVETREEITEM saveItem,
    [in] ULONG celt,
    [in, out, size_is(celt)] VSSAVETREEITEM rgSaveTreeItems[],
    [out] ULONG *pcActual
);

Notes for Implementers

The method can return either the number of related save items, or it can return information about the related save items. The method returns the number of VSSAVETREEITEM items in pcActual if celt is zero and pcActual is not nulla null reference (Nothing in Visual Basic).

Note

If celt is not zero, rgSaveTreeItems must not be nulla null reference (Nothing in Visual Basic).

This behavior yields a common pattern of finding the number of related items and then retrieving information about the items, as in the following code. The code omits error checking for readability.

hr = pIVsHasRelatedSaveItems->GetRelatedSaveTreeItems(saveItem, 
        0, NULL, &cExpected);
prgSaveTreeItems = ::CoTaskMemAlloc(
        cExpected * sizeof(VSSAVETREEITEM));
hr = pIVsHasRelatedSaveItems->GetRelatedSaveTreeItems(saveItem,
        cExpected, prgSaveTreeItems, &cActual);

.NET Framework Security

See Also

Reference

IVsHasRelatedSaveItems Interface

Microsoft.VisualStudio.Shell.Interop Namespace