Compartilhar via


IVsCompletionSetEx.CompareItems(String, String, Int32, Int32) Method

Definition

Compares two completor items.

public:
 int CompareItems(System::String ^ bstrSoFar, System::String ^ bstrOther, int lCharactersToCompare, [Runtime::InteropServices::Out] int % pLResult);
int CompareItems(std::wstring const & bstrSoFar, std::wstring const & bstrOther, int lCharactersToCompare, [Runtime::InteropServices::Out] int & pLResult);
public int CompareItems (string bstrSoFar, string bstrOther, int lCharactersToCompare, out int pLResult);
abstract member CompareItems : string * string * int * int -> int
Public Function CompareItems (bstrSoFar As String, bstrOther As String, lCharactersToCompare As Integer, ByRef pLResult As Integer) As Integer

Parameters

bstrSoFar
String

[in] First string to compare to.

bstrOther
String

[in] Second string to compare to first string.

lCharactersToCompare
Int32

[in] Number of characters to compare.

pLResult
Int32

[out] Result of comparison.

Returns

If the method is successful, returns S_OK; otherwise, returns an error code (in which case the default comparison is used).

Remarks

COM Signature

From textmgr2.idl:

HRESULT IVsCompletionSetEx::CompareItems(  
   [in]const BSTR bstrSoFar,  
   [in]const BSTR bstrOther,  
   [in]long lCharactersToCompare,  
   [out]long* plResult  
);  

This method provides a way to find a matching item in the completion list in a language-specific way. Compare the 1st lCharactersToCompare characters of two completer items and set the plResult parameter to one of the following conditions:

value Meaning
plResult< 0 bstrSoFar comes before bstrOther
plResult == 0 bstrSoFar is equivalent to bstrOther
plResult > 0 bstrSoFar comes after bstrOther

Applies to