Compartilhar via


IVsObjectList2.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.8.0 (in Microsoft.VisualStudio.Shell.Interop.8.0.dll)

Syntax

'Declaration
Function GetText ( _
    index As UInteger, _
    tto As VSTREETEXTOPTIONS, _
    <OutAttribute> ByRef ppszText As String _
) As Integer
int GetText(
    uint index,
    VSTREETEXTOPTIONS tto,
    out string ppszText
)
int GetText(
    [InAttribute] unsigned int index, 
    [InAttribute] VSTREETEXTOPTIONS tto, 
    [OutAttribute] String^% ppszText
)
abstract GetText : 
        index:uint32 * 
        tto:VSTREETEXTOPTIONS * 
        ppszText:string byref -> int
function GetText(
    index : uint, 
    tto : VSTREETEXTOPTIONS, 
    ppszText : String
) : int

Parameters

  • index
    Type: UInt32

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

  • ppszText
    Type: 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: Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From vsshell80.idl:

[C++]

HRESULT IVsObjectList2::GetText(
   [in] ULONG Index, 
   [in] VSTREETEXTOPTIONS tto, 
   [out] const WCHAR **ppszText
);

This method returns a string containing various text elements for the tree list item. Strings 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. Strings for other VSTREETEXTOPTIONS enumeration values only need to remain intact until the next GetText call, at which time they may be discarded or reused.

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

.NET Framework Security

See Also

Reference

IVsObjectList2 Interface

Microsoft.VisualStudio.Shell.Interop Namespace