Help Center

DVARIANT.ChangeTypeExmethod

Converts the variant from one type to another.

COMmethodDVARIANT.INCdocumented

Syntax

FUNCTION ChangeTypeEx (BYVAL vtNew AS VARTYPE, BYVAL lcid AS LCID = 0, BYVAL wFlags AS USHORT = 0) AS HRESULT

Parameters

NameDescription
vtNewThe new variant type.
lcidThe locale identifier. The LCID is useful when the type of the source or destination VARIANTARG is VT_BSTR, VT_DISPATCH, or VT_DATE.
wFlagsVARIANT_NOVALUEPROP : Prevents the function from attempting to coerce an object to a fundamental type by getting the Value property. Applications should set this flag only if necessary, because it makes their behavior inconsistent with other applications.
VARIANT_ALPHABOOL : Converts a VT_BOOL value to a string containing either "True" or "False".
VARIANT_NOUSEROVERRIDE : For conversions to or from VT_BSTR, passes LOCALE_NOUSEROVERRIDE to the core coercion routines.
VARIANT_LOCALBOOL : For conversions from VT_BOOL to VT_BSTR and back, uses the language specified by the locale in use on the local computer.

Return value

Returns S_OK (0) or an HRESULT error code.

Description

Converts the variant from one type to another.

Reference

  • Include file DVARIANT.INC
  • Defined in AfxNova/DVARIANT.inc:2325
  • Documented in COM/DVARIANT Class.md
  • Topic: DVARIANT Class