Help Center

DVARIANT.ChangeTypemethod

Converts the variant from one type to another.

COMmethodDVARIANT.INCdocumented

Syntax

FUNCTION ChangeType (BYVAL vtNew AS VARTYPE, BYVAL wFlags AS USHORT = 0) AS HRESULT

Parameters

NameDescription
vtNewThe new variant type.
wFlagsVARIANT_NOVALUEPROP : Prevents the function from coercing 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:2318
  • Documented in COM/DVARIANT Class.md
  • Topic: DVARIANT Class