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 code | Description |
|---|---|
|
The comparison was successful. |
|
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.
| Value | Condition |
|---|---|
| -1 | string1 is less than string2. |
| 0 | string1 equals string2. |
| 1 | string1 is greater than string2. |
Requirements
|
Minimum supported client |
Windows 8 [desktop apps | Windows Store apps] |
|---|---|
|
Minimum supported server |
Windows Server 2012 [desktop apps | Windows Store apps] |
|
Minimum supported phone |
Windows Phone 8 |
|
Header |
|
|
Library |
|