Export (0) Print
Expand All
Expand Minimize

WindowsCompareStringOrdinal function

Compares two specified HSTRING objects and returns an integer that indicates their relative position in a sort order.

Syntax


HRESULT WINAPI WindowsCompareStringOrdinal(
  _In_   HSTRING string1,
  _In_   HSTRING string2,
  _Out_  INT32 *result
);

Parameters

string1 [in]

Type: HSTRING

The first string to compare.

string2 [in]

Type: HSTRING

The second string to compare.

result [out]

Type: INT32*

A value that indicates the lexical relationship between string1 and string2.

Return value

Type: HRESULT

This function can return one of these values.

Return codeDescription
S_OK

The comparison was successful.

E_INVALIDARG

result is NULL.

 

Remarks

Use the WindowsCompareStringOrdinal function to compare two HSTRING objects. After the comparison completes, the result out parameter contains one of three values.

ValueCondition
-1string1 is less than string2.
0string1 equals string2.
1string1 is greater than string2.

 

Windows Phone 8: This API is supported.

Windows Phone 8.1: This API is supported.

Requirements

Minimum supported client

Windows 8 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2012 [desktop apps | Windows Store apps]

Header

Winstring.h

Library

WinRTType.lib

 

 

Community Additions

ADD
Show:
© 2014 Microsoft