Dll中导出类--Delphi实战之一[4]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 musicwind 的 blog

1.  function getclasscount: integer; stdcall;

告诉调用者,本dll中共有几个子类;

2function getclasstypebyindex(const iindex: integer;

  var classtype: mybaseformclass): wordbool; stdcall;

以索引方式获得具体的子类。注意,此处的classtype的类型是mybaseformclass,这表明,它的值将是一个确定的自tmybaseform继承而来的类。

以下是它们可能的一种实现:

function getclasscount: integer;

begin

  result := 3; //表明本dll中导出了3个类

end;

 

function getclasstypebyindex(const iindex: integer;

  var classtype: mybaseformclass): wordbool;

begin

  result := true;

  case iindex of

    0: classtype := tfrmtest1;

       1: classtype := tfrmtest2;

       2: classtype := tfrmtest3;

    else

      result := false;

  end;

end;

本文关键:Dll 导出 类 Delphi 实战 Musicwind
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top