RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TConvTypeProcs.Create Constructor

Creates an instance of TConvTypeProcs.

Pascal
constructor Create(const AConvFamily: TConvFamily; const ADescription: string; const AToCommonProc: TConversionProc; const AFromCommonProc: TConversionProc);
C++
__fastcall TConvTypeProcs(const TConvFamily AConvFamily, const AnsiString ADescription, const TConversionProc AToCommonProc, const TConversionProc AFromCommonProc);

Call Create to instantiate a TConvTypeProcs descendant at runtime. This descendant can then be passed to the RegisterConversionType function in order to register a new conversion type. There is no need to instantiate TConvTypeProcs instances directly, because the RegisterConversionType function creates a new TConvTypeProcs instance when you register a conversion type by specifying two conversion functions. 

Create assigns the AConvFamily parameter to the ConvFamily property, and the ADescription parameter to the Description property. It saves the AToCommonProc and AFromCommonProc parameters, which it then uses to implement the FromCommon and ToCommon methods. 

If AConvFamily is not the identifier of a registered conversion family, Create raises an EConversionError exception. 

 

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