Show: Delphi
C++
Display Preferences
Creating a Class to Enable the Custom Variant Type
From RAD Studio
Go Up to Using the RTL Index
Custom variants work by using a special helper class that indicates how variants of the custom type can perform standard operations. You create this helper class by writing a descendant of System.Variants.TCustomVariantType. This involves overriding the appropriate virtual methods of TCustomVariantType.
The following topics provide details on how to implement and use a TCustomVariantType descendant:
- Enabling casting
- Implementing binary operations
- Implementing comparison operations
- Implementing unary operations
- Copying and clearing custom variants
- Loading and saving custom variant values
- Using the TCustomVariantType descendant