Http://www.cnblogs.com/yangxuming/p/6707459.html
Type
Tcontrolcls = Class of Tcontrol;
function Createcomponent (CONTROLCLS:TCONTROLCLS): Tcontrol;
Begin
Result:=controlcls.create (FORM1);
...
End
function Createcomponent (Controlcls:tcontrol): Tcontrol;
Begin
Result:=controlcls.create (FORM1);
...
End
The former requires passing in a class, and the latter requires passing in an object (an instance of the class)
Type
MYCLASSREF=CALSS of CMyClass//represents myclassref as a pointer to CMyClass or its parent class
A reference to a class is just like a pointer to a class
A class reference is the type of a class, and you can declare a class reference variable to assign it to a class, and you can create an instance of the object from that variable.
Classes and the like
When you are unsure of the class model to invoke, use the class.
It can also be said to be a class pointer ~
At the time of program compilation, you want to call the category method with a category name or a special item. Or a virtual constructor, but you do not know the actual data type of the class or object, this time the category reference is very useful.
Delphi Class of reference