Export (0) Print
Expand All

IWbemClassObject::CompareTo method

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

Syntax


HRESULT CompareTo(
  [in]  LONG lFlags,
  [in]  IWbemClassObject *pCompareTo
);

Parameters

lFlags [in]

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.

ValueMeaning
WBEM_FLAG_IGNORE_OBJECT_SOURCE

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

WBEM_FLAG_IGNORE_QUALIFIERS

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

WBEM_FLAG_IGNORE_DEFAULT_VALUES

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

WBEM_FLAG_IGNORE_FLAVOR

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).

WBEM_FLAG_IGNORE_CASE

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.

WBEM_FLAG_IGNORE_CLASS

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.

 

pCompareTo [in]

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 table lists the value contained within an HRESULT.

Return codeDescription
WBEM_E_FAILED

An unspecified error has occurred.

WBEM_E_INVALID_PARAMETER

A specified parameter is not valid.

WBEM_E_OUT_OF_MEMORY

There was not enough memory to complete the operation.

WBEM_S_DIFFERENT

The objects are different.

WBEM_S_SAME

The objects are the same, subject to comparison flags.

 

Examples

For script code examples, see WMI Tasks for Scripts and Applications and the TechNet ScriptCenter Script Repository.

For C++ code examples, see WMI C++ Application Examples.

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows Server 2003

Header

Wbemcli.h (include Wbemidl.h)

Library

Wbemuuid.lib

DLL

CIMWin32.dll;
Esscli.dll;
Evntrprv.dll;
Fastprox.dll;
Framedyn.dll;
Krnlprov.dll;
Ncprov.dll;
Wbemcore.dll;
Wbemess.dll;
Wmipiprt.dll

See also

IWbemClassObject
Qualifier Flavors

 

 

Show:
© 2014 Microsoft