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
saveItem
Type: Microsoft.VisualStudio.Shell.Interop.VSSAVETREEITEM[in] Pointer to a VSSAVETREEITEM structure containing information about the item to check for related items.
celt
Type: UInt32[in] Zero or the number of items in rgSaveTreeItems. See Remarks.
rgSaveTreeItems
Type: array<Microsoft.VisualStudio.Shell.Interop.VSSAVETREEITEM[][in, out] Pointer to an array of VSSAVETREEITEM structures containing information about related items to save.
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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.