H
hying95
Unregistered / Unconfirmed
GUEST, unregistred user!
自定义个类型:type RDate=record Arg: Integer;
arry: array of string;
end;
var hThread:Thandle;//定义一个句柄 ThreadIDWord;function MyThreadFunc(Pointer):RDate;stdcall;var i:longint;
N: Integer;
begin
N:=Integer(p^);
SetLength(Result.arry,N);
for i:=0 to Result.Arg-1do
Result.arry:=IntToStr(i);
end;
procedure TForm1.btn1Click(Sender: TObject);var p: Pointer;
i: Integer;
PDate: RDate;
begin
i:=StrToInt(Edit1.Text);
P:=@(I);
//我要创建一个线程,并把Edit1中输入的数字传进我的线程函数,如何得到然后得到返回结果,用Edit2.text:=PDate.Arry[0]结果, hthread:=CreateThread(nil,0,@MyThreadfunc,P,0,ThreadID);
//EDIT2如何得到结果?end;
arry: array of string;
end;
var hThread:Thandle;//定义一个句柄 ThreadIDWord;function MyThreadFunc(Pointer):RDate;stdcall;var i:longint;
N: Integer;
begin
N:=Integer(p^);
SetLength(Result.arry,N);
for i:=0 to Result.Arg-1do
Result.arry:=IntToStr(i);
end;
procedure TForm1.btn1Click(Sender: TObject);var p: Pointer;
i: Integer;
PDate: RDate;
begin
i:=StrToInt(Edit1.Text);
P:=@(I);
//我要创建一个线程,并把Edit1中输入的数字传进我的线程函数,如何得到然后得到返回结果,用Edit2.text:=PDate.Arry[0]结果, hthread:=CreateThread(nil,0,@MyThreadfunc,P,0,ThreadID);
//EDIT2如何得到结果?end;