Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

VARIANT Structure

Most of the Microsoft Active Accessibility functions and the IAccessible properties and methods take a VARIANT structure as a parameter. Essentially, the VARIANT structure is a container for a large union that carries many types of data.

The value in the first member of the structure, vt, describes which of the union members is valid. Although the VARIANT structure supports many different data types, Microsoft Active Accessibility uses only the following types.

vt ValueCorresponding value member name


When you receive information in a VARIANT structure, check the vt member to find out which member contains valid data. Similarly, when you send information using a VARIANT structure, always set vt to reflect the union member that contains the information.

Before using the structure, initialize it by calling the VariantInit Component Object Model (COM) function. When finished with the structure, clear it before the memory that contains the VARIANT is freed by calling VariantClear.



Community Additions

© 2015 Microsoft