Share via


IDeclarations::GetBestMatch Method

Returns the index position of the best match for a string of text.

HRESULT GetBestMatch ( 
   BSTR text,
   long* index,
   VARIANT_BOOL* uniqueMatch
);

Parameters

  • text
    [in] The user text that requires a match for statement completion information.

  • index
    [out] Returns the index position of the closest matching item in the IDeclarations Interface set or completion list.

  • uniqueMatch
    [out] Returns whether a unique match was made. If the item specified by the index parameter is a unique match, then its return value is TRUE. If there is more than one matching item then return FALSE.

Return Value

If the method finds an item whose prefix matches the text, then return S_OK; otherwise, return S_FALSE (the uniqueMatch parameter value is ignored).

Remarks

This method is called to highlight the item in the completion list that most closely matches what the user has typed so far. The index returned from this method is passed to the IDeclarations::GetDescription Method, the IDeclarations::GetGlyph Method, and the IDeclarations::GetName Method.

See Also

Reference

IDeclarations Interface