Com Variant

A DiscriminatedUnion introduced by MicroSoft's ComAutomation.

The Variant DataType is a struct consiting of a member "vt", which contains the enum for the type currently stored in the Variant, and a union who's largest member is a decimal stored as a 12 byte unsigned integer scaled by a variable power of 10. Thusly, a Variant is always costs you 16 bytes at minimum.


Variants are used by ScriptingLanguages because they are typeless. However, Variants also are used as a form of enabling overloading for an property/method in an interface.

Actually, Variants are used by typeless ScriptingLanguages?. Some aren't typeless. --PierrePhaneuf


Note: The actual TypeName? is Variant, but that's not a valid WikiName.

VC++ has a non-heinous wrapper called _variant_t.


CategoryComponentObjectModel


EditText of this page (last edited June 3, 2003) or FindPage with title or text search