Share via


ITextRangeProvider::CompareEndpoints Method

Returns a value that specifies whether two text ranges have identical endpoints.

Syntax

HRESULT CompareEndpoints(      
    TextPatternRangeEndpoint endpoint,
    ITextRangeProvider *targetRange,
    TextPatternRangeEndpoint targetEndpoint,
    int *pRetVal
);

Parameters

  • endpoint
    [in] A value from the TextPatternRangeEndpointEnum enumerated type specifying the endpoint (starting or ending) of the caller.
  • targetRange
    [in] The address of the ITextRangeProvider interface of the text range to be compared.
  • targetEndpoint
    [in] A value from the TextPatternRangeEndpointEnum enumerated type specifying the endpoint (starting or ending) of the target ITextRangeProvider.
  • pRetVal
    [out, retval] The address of a variable that receives a value that specifies whether two text ranges have identical endpoints. This parameter is passed uninitialized.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

Returns a negative value if the caller's endpoint occurs earlier in the text than the target endpoint.

Returns zero if the caller's endpoint is at the same location as the target endpoint.

Returns a positive value if the caller's endpoint occurs later in the text than the target endpoint.

See Also

UI Automation Providers Overview, ITextProvider