K
kocus
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button1Click(Sender: TObject);
var i:integer;
threadid:dword;
begin
CreateThread(nil,0,@tform1.threadfunc,label1,0,threadid);
end;
function tform1.ThreadFunc(var l:Tlabel):boolean;
begin
while strtoint(l.Caption)<10000do
l.Caption:=inttostr(strtoint(l.Caption)+1);
end;
运行后 他说非法访问0xfffffffff,说明label1没有传到l上
为什么会这样啊?
var i:integer;
threadid:dword;
begin
CreateThread(nil,0,@tform1.threadfunc,label1,0,threadid);
end;
function tform1.ThreadFunc(var l:Tlabel):boolean;
begin
while strtoint(l.Caption)<10000do
l.Caption:=inttostr(strtoint(l.Caption)+1);
end;
运行后 他说非法访问0xfffffffff,说明label1没有传到l上
为什么会这样啊?