X
xjk00
Unregistered / Unconfirmed
GUEST, unregistred user!
在DELPHI中如何将类类型与类实例作为参数传递进函数中:
type childform=class(fatherform)
---
public username,usercom:stirng;
---
end;
type anotherform=class()
---
public
procedure makewindowopen(windowname:string;sender:TComponentClass);
---
end;
implementation
{$R *.dfm}
procedure makewindowopen(windowname:string;sender:TComponentClass);
var
x:TComponentClass;
begin
if application.FindComponent(windowname)=nil then
begin
application.CreateForm(sender,x);
x.username:=username;
x.usercom:=usercom
x.Show;
end;
end;
以上问题出错。
type childform=class(fatherform)
---
public username,usercom:stirng;
---
end;
type anotherform=class()
---
public
procedure makewindowopen(windowname:string;sender:TComponentClass);
---
end;
implementation
{$R *.dfm}
procedure makewindowopen(windowname:string;sender:TComponentClass);
var
x:TComponentClass;
begin
if application.FindComponent(windowname)=nil then
begin
application.CreateForm(sender,x);
x.username:=username;
x.usercom:=usercom
x.Show;
end;
end;
以上问题出错。