VarBstrCmp function (oleauto.h)

Compares two variants of type BSTR.

Syntax

HRESULT VarBstrCmp(
  [in] BSTR  bstrLeft,
  [in] BSTR  bstrRight,
  [in] LCID  lcid,
  [in] ULONG dwFlags
);

Parameters

[in] bstrLeft

The first variant.

[in] bstrRight

The second variant.

[in] lcid

The locale identifier of the program to determine whether UNICODE or ANSI strings are being used.

[in] dwFlags

The following are compare results flags.

Value Meaning
NORM_IGNORECASE
0x00000001
Ignore case.
NORM_IGNORENONSPACE
0x00000002
Ignore nonspace characters.
NORM_IGNORESYMBOLS
0x00000004
Ignore symbols.
NORM_IGNOREWIDTH
0x00000008
Ignore string width.
NORM_IGNOREKANATYPE
0x00000040
Ignore Kana type.
NORM_IGNOREKASHIDA
0x00040000
Ignore Arabic kashida characters.

Return value

This function can return one of these values.

Return code/value Description
VARCMP_LT
0
bstrLeft is less than bstrRight.
VARCMP_EQ
1
The parameters are equal.
VARCMP_GT
2
bstrLeft is greater than bstrRight.

Remarks

This function will not compare arrays or records.

Requirements

Requirement Value
Target Platform Windows
Header oleauto.h
Library OleAut32.lib
DLL OleAut32.dll