IWbemClassObject::CompareTo method (wbemcli.h)

The IWbemClassObject::CompareTo method compares an object to another Windows Management object. Note that there are certain constraints in this comparison process.


HRESULT CompareTo(
  [in] long             lFlags,
  [in] IWbemClassObject *pCompareTo


[in] lFlags

Specifies the object characteristics to consider in comparison to another object. It can be WBEM_COMPARISON_INCLUDE_ALL to consider all features, or any combination of these flags.


Ignore the source of the objects, namely the server and the namespace they came from, in comparison to other objects.


Ignore all qualifiers (including Key and Dynamic) in comparison.


Ignore default values of properties. This flag is only meaningful when comparing classes.


Ignore qualifier flavors. This flag still takes qualifier values into account, but ignores flavor distinctions such as propagation rules and override restrictions (for more information, see Qualifier Flavors).


Compare string values in a case-insensitive manner. This applies both to strings and to qualifier values. Property and qualifier names are always compared in a case-insensitive manner whether this flag is specified or not.


Assume that the objects being compared are instances of the same class. Consequently, this flag compares instance-related information only. Use this flag to optimize performance. If the objects are not of the same class, the results are undefined.

[in] pCompareTo

Object in comparison. This pointer must point to a valid IWbemClassObject instance. It cannot be NULL.

Return value

This method returns an HRESULT indicating the status of the method call. The following list lists the value contained within an HRESULT. For general HRESULT values, see System Error Codes.


Requirement Value
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header wbemcli.h (include Wbemidl.h)
Library WbemUuid.lib
DLL CIMWin32.dll; Esscli.dll; Fastprox.dll; FrameDyn.dll; FrameDynOS.dll; Krnlprov.dll; Ncprov.dll; Wbemcore.dll; Wbemess.dll; Wmipiprt.dll

See also


Qualifier Flavors