Udostępnij za pośrednictwem


IVsCompletionSet.GetDisplayText(Int32, String, Int32[]) Method

Definition

Returns the text of a completion set item as it appears in the completion set list.

int GetDisplayText(int iIndex, [Runtime::InteropServices::Out] std::wstring const & & ppszText, std::Array <int> const & piGlyph);
public int GetDisplayText (int iIndex, out string ppszText, int[] piGlyph);
abstract member GetDisplayText : int * string * int[] -> int
Public Function GetDisplayText (iIndex As Integer, ByRef ppszText As String, Optional piGlyph As Integer()) As Integer

Parameters

iIndex
Int32

[in] Index of completion set item to return display text for.

ppszText
String

[out] Returns a string containing the display text.

piGlyph
Int32[]

[out] Returns an integer identifying the glyph to display next to the completion item.

Returns

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

Remarks

COM Signature

From textmgr.idl:

HRESULT IVsCompletionSet::GetDisplayText(  
   [in] long iIndex,  
   [out] WCHAR **ppszText,  
   [out, optional] long *piGlyph  
);  

The string returned should be maintained by the completion set object, and the string should remain valid until final release, or until updated by calling UpdateCompletionStatus. GetImageList is used by the view to determine the list of images associated with a completion set.

Note

The string is typically created by the completion set object and the string must persist for the life of that object or until the Dismiss method is called.

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.

Applies to