RAD Studio
ContentsIndex
PreviousUpNext
Using the TCustomVariantType Descendant

In the initialization section of the unit that defines your TCustomVariantType descendant, create an instance of your class. When you instantiate your object, it automatically registers itself with the variant-handling system so that the new Variant type is enabled. For example, here is the initialization section of the VarCmplx unit:

initialization
ComplexVariantType := TComplexVariantType.Create;

In the finalization section of the unit that defines your TCustomVariantType descendant, free the instance of your class. This automatically unregisters the variant type. Here is the finalization section of the VarCmplx unit:

finalization
FreeAndNil(ComplexVariantType);
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!