H
hbffff
Unregistered / Unconfirmed
GUEST, unregistred user!
怎么做一个通用的调用form的函数?
procedure CreatForm(form: Tobject);
begin
if not(assigned(form)) then
begin
form:=form.create as (form.classtype);
//出现非法内存访问,此时的form.classtype是Tobject还是实参的class?
end;
(form as Tform).Show;
end;
//以下是一个caller
procedure Tmain.providerchooseClick(Sender: TObject);
begin
CreatForm( providerinfo_form);
end;
procedure CreatForm(form: Tobject);
begin
if not(assigned(form)) then
begin
form:=form.create as (form.classtype);
//出现非法内存访问,此时的form.classtype是Tobject还是实参的class?
end;
(form as Tform).Show;
end;
//以下是一个caller
procedure Tmain.providerchooseClick(Sender: TObject);
begin
CreatForm( providerinfo_form);
end;