TDllClass = Class of TDll;
  TDll = Class;TDll声明一个类,那TDllClass是什么意思,怎么理解?

解决方案 »

  1.   

    TDllClass 是类的类型(是一种类的类),也叫元类,其构造形式为:class of Type
      

  2.   

    看来 csdn 上还是有不少人 不知道还乱说 啊。楼上正解。
      

  3.   

    建议楼主看看《Delphi高手突破》里面有详细介绍
      

  4.   

    看看VCL源码就知道了,下面是动态创建窗体。procedure TApplication.CreateForm(InstanceClass: TComponentClass; var Reference);
    var
      Instance: TComponent;
    begin
      Instance := TComponent(InstanceClass.NewInstance);
      TComponent(Reference) := Instance;
      try
        Instance.Create(Self);
      except
        TComponent(Reference) := nil;
        raise;
      end;
      if (FMainForm = nil) and (Instance is TForm) then
      begin
        TForm(Instance).HandleNeeded;
        FMainForm := TForm(Instance);
      end;
    end;
      

  5.   

    居然有人说我不懂乱说,找本书来一翻,NND,果然是睁眼说瞎话
    正解叫做"类引用(class reference)",有时候又叫做"元类(metaclass)"