VariantCompare function (propvarutil.h)

Compares two variant structures, based on default comparison rules.

Syntax

PSSTDAPI_(int) VariantCompare(
  [in] REFVARIANT var1,
  [in] REFVARIANT var2
);

Parameters

[in] var1

Type: REFVARIANT

Reference to a first variant structure.

[in] var2

Type: REFVARIANT

Reference to a second variant structure.

Return value

Type: INT

  • Returns 1 if var1 is greater than var2
  • Returns 0 if var1 equals var2
  • Returns -1 if var1 is less than var2

Remarks

Note  This function does not support the comparison of different VARIANT types. If the types named in var1 and var2 are different, the results are undefined and should be ignored. Calling applications should ensure that they are comparing two of the same type before they call this function. The PropVariantChangeType function can be used to convert the two structures to the same type.
 
By default, VT_NULL / VT_EMPTY / 0-element vectors are considered to be less than any other vartype.

Requirements

Requirement Value
Minimum supported client Windows XP with SP2, Windows Vista [desktop apps only]
Minimum supported server Windows Server 2003 with SP1 [desktop apps only]
Target Platform Windows
Header propvarutil.h
Library Propsys.lib
DLL Propsys.dll (version 6.0 or later)
Redistributable Windows Desktop Search (WDS) 3.0