Share via


IUIAutomationTextRange::Compare Method

Retrieves a value that specifies whether the span of this text range is the same as that of another text range.

Syntax

HRESULT Compare(      
    IUIAutomationTextRange *range,
    BOOL *areSame
);

Parameters

  • range
    [in] The address of the IUIAutomationTextRange interface of the text range to compare with this one.
  • areSame
    [out, retval] The address of a variable that receives the value: TRUE if the text ranges have identical spans, otherwise FALSE.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

The comparison of text range is made by comparing endpoints and not by comparing the text contained within the ranges. Two text ranges are not necessarily indentified as the same just because IUIAutomationTextRange::GetText returns the exact same text from the two ranges. They can be still different text ranges if one or both endpoints are pointing to logically different location in the document object model