RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomVariantType.Create Constructor ()

Creates an instance of TCustomVariantType.

Pascal
constructor Create; overload;
constructor Create(RequestedVarType: TVarType); overload;
C++
__fastcall TCustomVariantType();
__fastcall TCustomVariantType(TVarType RequestedVarType);

Call Create in the initialization section of the unit that defines your TCustomVariantType descendant to instantiate a single instance of the custom Variant type. This single instance automatically registers itself with the Variant system so that the custom Variant type is enabled in the application. 

The RequestedVarType parameter specifies a type code for the new custom Variant type. It must be in the range from $010F to $0FFF. 

When called with no parameters, the constructor generates a new type code for the custom Variant type. 

The TCustomVariantType constructor raises an exception if there is a problem with the new Variant type code. Such problems include 

The RequestedVarType parameter specifies a type code that is already used by another Variant type. 

The RequestedVarType parameter specifies a type code that is not in the valid range for custom Variants

There are too many custom Variants already defined to allow another one. 

 

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