---
name: "VarBstrCmp"
section: "3w"
platform: "linux"
package: "libwine-dev"
version: "1.4.1-4"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/VarBstrCmp"
---

# VarBstrCmp(3w)

## NAME

**VarBstrCmp** (OLEAUT32.314)

## SYNOPSIS

HRESULT VarBstrCmp\
  (\
   BSTR  *pbstrLeft*,\
   BSTR  *pbstrRight*,\
   LCID  *lcid*,\
   DWORD *dwFlags*\
  )

## DESCRIPTION

Compare two **BSTR** values.

## PARAMS

*pbstrLeft* **\[In\]**  Source.

*pbstrRight* **\[In\]**  Value to compare.

*lcid* **\[In\]**  **LCID** for the comparison.

*dwFlags* **\[In\]**  Flags to pass directly to **[CompareStringW(3w)](/CompareStringW/3w.md)**.

## RETURNS

**VARCMP\_LT**, **VARCMP\_EQ** or **VARCMP\_GT** indicating that *pbstrLeft* is less than, equal to or greater than *pbstrRight* respectively.

## NOTES

**VARCMP\_NULL** is **NOT** returned if either string is **NULL** unlike **MSDN** states. A **NULL** BSTR pointer is equivalent to an empty string. If **LCID** is equal to **0**, a byte by byte comparison is performed.

## IMPLEMENTATION

Declared in **"oleauto.h"**.

Implemented in **"dlls/oleaut32/vartype.c"**.

Debug channel **"variant"**.
