次の方法で共有


IVsLiteTreeList.GetText Method

Returns a pointer to the text representations for the requested tree list item.

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

Syntax

'宣言
Function GetText ( _
    index As UInteger, _
    tto As VSTREETEXTOPTIONS, _
    <OutAttribute> ByRef ppszText As String _
) As Integer
'使用
Dim instance As IVsLiteTreeList
Dim index As UInteger
Dim tto As VSTREETEXTOPTIONS
Dim ppszText As String
Dim returnValue As Integer

returnValue = instance.GetText(index, _
    tto, ppszText)
int GetText(
    uint index,
    VSTREETEXTOPTIONS tto,
    out string ppszText
)
int GetText(
    [InAttribute] unsigned int index, 
    [InAttribute] VSTREETEXTOPTIONS tto, 
    [OutAttribute] String^% ppszText
)
function GetText(
    index : uint, 
    tto : VSTREETEXTOPTIONS, 
    ppszText : String
) : int

Parameters

  • index
    Type: System.UInt32

    [in] Specifies the zero based index of the item of interest.

  • ppszText
    Type: System.String%

    [out] Pointer to a text string from the specified tree list item. Implementers must allocate this string and keep the pointer valid as per the remarks below.

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 IVsLiteTreeList::GetText(
   [in] ULONG Index,
   [in] VSTREETEXTOPTIONS tto,
   [out] const WCHAR **ppszText
);

This method returns a pointer to a string containing various text elements for the tree list item. String pointers returned for TTO_SORTTEXT must remain valid and unchanged for the lifetime of the list as they are used to continually sort and resort the list. String pointers for other VSTREETEXTOPTIONS enumeration values only need to remain intact until the next GetText call, at which time they may be discarded or reused.

Note

The text buffer is created by the IVsLiteTreeList object and the buffer must persist for the life of the IVsLiteTreeList object.

If you are implementing this interface in managed code and you need to have the string disposed of by the caller, implement the IVsCoTaskMemFreeMyStrings interface on the IVsLiteTreeList interface.

Permissions

See Also

Reference

IVsLiteTreeList Interface

IVsLiteTreeList Members

Microsoft.VisualStudio.Shell.Interop Namespace