Share via


IVsCompletionSetEx.CompareItems Method

Compares two completor items.

Namespace:  Microsoft.VisualStudio.TextManager.Interop
Assembly:  Microsoft.VisualStudio.TextManager.Interop.8.0 (in Microsoft.VisualStudio.TextManager.Interop.8.0.dll)

Syntax

'Declaration
Function CompareItems ( _
    bstrSoFar As String, _
    bstrOther As String, _
    lCharactersToCompare As Integer, _
    <OutAttribute> ByRef pLResult As Integer _
) As Integer
int CompareItems(
    string bstrSoFar,
    string bstrOther,
    int lCharactersToCompare,
    out int pLResult
)
int CompareItems(
    [InAttribute] String^ bstrSoFar, 
    [InAttribute] String^ bstrOther, 
    [InAttribute] int lCharactersToCompare, 
    [OutAttribute] int% pLResult
)
abstract CompareItems : 
        bstrSoFar:string * 
        bstrOther:string * 
        lCharactersToCompare:int * 
        pLResult:int byref -> int
function CompareItems(
    bstrSoFar : String, 
    bstrOther : String, 
    lCharactersToCompare : int, 
    pLResult : int
) : int

Parameters

  • bstrOther
    Type: System.String

    [in] Second string to compare to first string.

  • lCharactersToCompare
    Type: System.Int32

    [in] Number of characters to compare.

Return Value

Type: System.Int32
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

.NET Framework Security

See Also

Reference

IVsCompletionSetEx Interface

Microsoft.VisualStudio.TextManager.Interop Namespace