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

# VarBoolFromStr(3w)

## NAME

**VarBoolFromStr** (OLEAUT32.125)

## SYNOPSIS

HRESULT VarBoolFromStr\
  (\
   OLECHAR\*      *strIn*,\
   LCID          *lcid*,\
   ULONG         *dwFlags*,\
   VARIANT\_BOOL\* *pBoolOut*\
  )

## DESCRIPTION

Convert a **VT\_BSTR** to a **VT\_BOOL**.

## PARAMS

*strIn* **\[In\]**  Source.

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

*dwFlags* **\[In\]**  Flags controlling the conversion (**VAR\_** flags from **"oleauto.h"**).

*pBoolOut* **\[Out\]**  Destination.

## RETURNS

**Success:** **S\_OK**.

**Failure:** **E\_INVALIDARG**, if *pBoolOut* is invalid. **DISP\_E\_TYPEMISMATCH**, if the type cannot be converted.

## NOTES

**-** *strIn* will be recognised if it contains **"#TRUE#"** or **"#FALSE#"**. Additionally, it may contain (in any case mapping) the text **"TRUE"** or **"FALSE"**.

**-** If *dwFlags* includes **VAR\_LOCALBOOL**, then the text may also match the localised text of **"TRUE"** or **"FALSE"** in the language specified by *lcid*.

**-** If none of these matches occur, the string is treated as a numeric string and the boolean *pBoolOut* will be set according to whether the number is zero or not. The *dwFlags* parameter is passed to **[VarR8FromStr(3w)](/VarR8FromStr/3w.md)** for this conversion.

**-** If the text is not numeric and does not match any of the above, then **DISP\_E\_TYPEMISMATCH** is returned.

## IMPLEMENTATION

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

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

Debug channel **"variant"**.
