Sdílet prostřednictvím


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

Definition

Compares two strings for the specified number of characters.

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

Parameters

bstrSoFar
String

The first string to compare.

bstrOther
String

The second string to compare.

lCharactersToCompare
Int32

The number of characters to compare.

plResult
Int32

[out] The result of the comparison.

Returns

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

Implements

Remarks

The plResult should be returned as follows: if bstrSoFar comes before bstrOther, plResult < 0. If bstrSoFar is equivalent to bstrOther, plResult is 0. If bstrSoFar comes after bstrOther, plResult > 0.

This method is the implementation of the CompareItems method of the IVsCompletionSetEx interface.

By default this method is not implemented and returns plResult as 0 and <xref:Microsoft.VisualStudio.NativeMethods.E_NOTIMPL>.

Applies to