1. function getclasscount: integer; stdcall;
告诉调用者,本dll中共有几个子类;
2.function 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;