VarCmp (OLEAUT32.176)
HRESULT VarCmp ( LPVARIANT left, LPVARIANT right, LCID lcid, DWORD flags )
Compare two variants.
left | [In] | First variant. |
right | [In] | Second variant. |
lcid | [In] | LCID (locale identifier) for the comparison. |
flags | [In] | Flags to be used in the comparison: NORM_IGNORECASE, NORM_IGNORENONSPACE, NORM_IGNORESYMBOLS, NORM_IGNOREWIDTH, NORM_IGNOREKANATYPE, NORM_IGNOREKASHIDA. |
VARCMP_LT: left variant is less than right variant. VARCMP_EQ: input variants are equal. VARCMP_GT: left variant is greater than right variant. VARCMP_NULL: either one of the input variants is NULL.
Failure: An HRESULT error code indicating the error.
Native VarCmp up to and including WinXP doesn't like I1, UI2, VT_UI4, UI8 and UINT as input variants. INT is accepted only as left variant.
If both input variants are ERROR then VARCMP_EQ will be returned, else an ERROR variant will trigger an error.
Both input variants can have VT_RESERVED flag set which is ignored unless one and only one of the variants is a BSTR and the other one is not an EMPTY variant. All four VT_RESERVED combinations have a different meaning:
- BSTR and other: BSTR is always greater than the other variant.
- BSTR|VT_RESERVED and other: a string comparison is performed.
- BSTR and other|VT_RESERVED: If the BSTR is a number a numeric comparison will take place else the BSTR is always greater.
- BSTR|VT_RESERVED and other|VT_RESERVED: It seems that the other variant is ignored and the return value depends only on the sign of the BSTR if it is a number else the BSTR is always greater. A positive BSTR is greater, a negative one is smaller than the other variant.
VarBstrCmp for the lcid and flags usage.
Declared in "include/oleauto.h". gitlab.winehq.org/wine/wine/blob/master/include/oleauto.h
Implemented in "dlls/oleaut32/variant.c". gitlab.winehq.org/wine/wine/blob/master/dlls/oleaut32/variant.c
Debug channel "variant".
Copyright © 2024 The Wine Project. All trademarks are the property of their respective owners. Visit WineHQ for license details. Generated Dec 2024.