PropVariantCompare function (propvarutil.h)

Compares two PROPVARIANT structures, based on default comparison units and settings.

Syntax

int PropVariantCompare(
  [in] REFPROPVARIANT propvar1,
  [in] REFPROPVARIANT propvar2
);

Parameters

[in] propvar1

Type: REFPROPVARIANT

Reference to the first PROPVARIANT structure.

[in] propvar2

Type: REFPROPVARIANT

Reference to the second PROPVARIANT structure.

Return value

Type: INT

  • Returns 1 if propvar1 is greater than propvar2
  • Returns 0 if propvar1 equals propvar2
  • Returns -1 if propvar1 is less than propvar2

Remarks

Calling PropVariantCompare is equivalent to calling PropVariantCompareEx with the PVCHF_DEFAULT flag.

This function compares only selected types, not all types.

By default, VT_NULL / VT_EMPTY / 0-element vectors are considered to be less than any other vartype.

If the vartypes are different, this function attempts to convert propvar2 to the vartype of propvar1 before comparing them.

This is an inline function, with its source code provided in the header. It is not included in any .dll or .lib file.

Requirements

Requirement Value
Minimum supported client Windows XP with SP2, Windows Vista [desktop apps | UWP apps]
Minimum supported server Windows Server 2003 with SP1 [desktop apps | UWP apps]
Target Platform Windows
Header propvarutil.h
Redistributable Windows Desktop Search (WDS) 3.0

See also

PropVariantCompareEx