The correspondence between VT and common data in VARIANT

Source: Internet
Author: User

For a variant that does not immediately assign a value, it is best to use void VariantInit (Variantarg far* Pvarg) for initialization, which essentially sets VT to VT_EMPTY, and the following table lists the corresponding relationships between VT and commonly used data:

Byte Bval; Vt_ui1.
Short ival; Vt_i2.
Long lval; VT_I4.
float Fltval; Vt_r4.
Double dblval; VT_R8.
Variant_bool Boolval; Vt_bool.
SCODE SCODE; Vt_error.
CY Cyval; Vt_cy.
Date date; Vt_date.
BSTR Bstrval; Vt_bstr.
DECIMAL far* pdecval//vt_byref| Vt_decimal.
IUnknown far* Punkval; Vt_unknown.
IDispatch far* Pdispval; Vt_dispatch.
SAFEARRAY far* Parray; vt_array|*.
Byte far* Pbval; Vt_byref| Vt_ui1.
Short far* pival; Vt_byref| Vt_i2.
Long far* Plval; Vt_byref| VT_I4.
float far* Pfltval; Vt_byref| Vt_r4.
Double far* pdblval; Vt_byref| VT_R8.
Variant_bool far* Pboolval; Vt_byref| Vt_bool.
SCODE far* Pscode; Vt_byref| Vt_error.
CY far* Pcyval; Vt_byref| Vt_cy.
DATE far* pdate; Vt_byref| Vt_date.
BSTR far* Pbstrval; Vt_byref| Vt_bstr.
IUnknown far* far* Ppunkval; Vt_byref| Vt_unknown.
IDispatch far* far* Ppdispval; Vt_byref| Vt_dispatch.
SAFEARRAY far* far* Pparray; vt_array|*.
VARIANT far* Pvarval; Vt_byref| Vt_variant.
void far* ByRef; Generic ByRef.
Char Cval; Vt_i1.
unsigned short uival; Vt_ui2.
unsigned long ulval; Vt_ui4.
int intval; Vt_int.
unsigned int uintval; Vt_uint.
Char FAR * PCVAL; Vt_byref| Vt_i1.
unsigned short FAR * puival; Vt_byref| Vt_ui2.
unsigned long FAR * PULVAL; Vt_byref| Vt_ui4.
int FAR * PINTVAL; Vt_byref| Vt_int.
unsigned int FAR * PUINTVAL; Vt_byref| Vt_uint.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.