delphi class of 类引用

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;

前者要求传入一个 类, 而后者要求传入一个 对象(类的实例)
type
MyClassRef=calss of CMyClass //表示MyClassRef为指向CMyClass或其父类的指针

类的引用就像指向类的指针一样
类引用就是类的类型,可以声明一个类引用变量赋给它一个类,可以通过这个变量创建对象的实例。

类之类
当你不确定调用的类模型时候用到类之类。
也可以说是类指针~

原文地址:https://www.cnblogs.com/yangxuming/p/6707459.html