CHString::Compare method

[The CHString class is part of the WMI Provider Framework which is now considered in final state, and no further development, enhancements, or updates will be available for non-security related issues affecting these libraries. The MI APIs should be used for all new development.]

The Compare method uses the wcscmp function to compare this CHString string with another string.

Syntax

int Compare(
  LPCWSTR lpsz
);

Parameters

lpsz

The other string used for comparison.

Return Value

The Compare method returns the following values.

Remarks

The Compare method, which performs a case-sensitive comparison of the strings, is not affected by locale.

Examples

The following code example shows the use of CHString::Compare:

CHString s1( L"abc" );
CHString s2( L"ABC" );

assert( s1.Compare( s2 ) > 0 ); // Compare with another CHString.
assert( s1.Compare( L"abc" ) == 0 ); // Compare with LPCWSTR string.

Requirements

   
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header chstring.h (include FwCommon.h)
Library FrameDyn.lib
DLL FrameDynOS.dll; FrameDyn.dll

See Also

CHString

CHString::Collate

CHString::CompareNoCase