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 System::Variant type. This single instance automatically registers itself with the System::Variant system so that the custom System::Variant type is enabled in the application. 

The RequestedVarType parameter specifies a type code for the new custom System::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 System::Variant type. 

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

The RequestedVarType parameter specifies a type code that is already used by another System::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) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!