Udostępnij za pośrednictwem


IVsCompletionSet.GetBestMatch(String, Int32, Int32, UInt32) Method

Definition

Determines the index of the closest matching completion set, given what has been typed so far.

public:
 int GetBestMatch(System::String ^ pszSoFar, int iLength, [Runtime::InteropServices::Out] int % piIndex, [Runtime::InteropServices::Out] System::UInt32 % pdwFlags);
int GetBestMatch(std::wstring const & pszSoFar, int iLength, [Runtime::InteropServices::Out] int & piIndex, [Runtime::InteropServices::Out] unsigned int & pdwFlags);
public int GetBestMatch (string pszSoFar, int iLength, out int piIndex, out uint pdwFlags);
abstract member GetBestMatch : string * int * int * uint32 -> int
Public Function GetBestMatch (pszSoFar As String, iLength As Integer, ByRef piIndex As Integer, ByRef pdwFlags As UInteger) As Integer

Parameters

pszSoFar
String

[in] A string containing the text typed by the user.

iLength
Int32

[in] Integer containing the length of the string.

piIndex
Int32

[out] Returns an integer specifying the index.

pdwFlags
UInt32

[out] Returns the type of match completed. For a list of pdwFlags values, see UpdateCompletionFlags.

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::GetBestMatch(  
   [in] const WCHAR *pszSoFar,  
   [in] long iLength,  
   [out] long *piIndex,  
   [out] DWORD *pdwFlags  
);  

Implement this method to determine the closest matching completion for a word given the text typed by the user. The view calls this method and passes in a string containing the text and the length of the string. In response to this call, return an index position into the completion set that identifies the best match, and a flag identifying the type of match performed.

The view calls this method only if CSF_CUSTOMMATCHING is specified in the completion set's flags.

If pdwFlags is set to either GBM_SELECT or GBM_UNIQUE, then the default matching in the view uses case-sensitive comparison.

Applies to