迷
迷惘的人
Unregistered / Unconfirmed
GUEST, unregistred user!
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
procedure show;
begin
form1.Label1.Caption:=inttostr(strtoint(form1.Label1.Caption)*2);
form1.Label2.Caption:=inttostr(strtoint(form1.Label1.Caption)*2);
end;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var hhandle:THandle;
ThreadIDWord;
begin
hhandle:=CreateThread(nil,0,@show,nil,0,ThreadID);
if ThreadID=0 then
messagebox(handle,'线程建立失败',nil,MB_ok);
end;
end.
创建线程时,系统老是报错:
[Error] Unit1.pas(37): Variable required
希望各位大虾指点迷津!
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
procedure show;
begin
form1.Label1.Caption:=inttostr(strtoint(form1.Label1.Caption)*2);
form1.Label2.Caption:=inttostr(strtoint(form1.Label1.Caption)*2);
end;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var hhandle:THandle;
ThreadIDWord;
begin
hhandle:=CreateThread(nil,0,@show,nil,0,ThreadID);
if ThreadID=0 then
messagebox(handle,'线程建立失败',nil,MB_ok);
end;
end.
创建线程时,系统老是报错:
[Error] Unit1.pas(37): Variable required
希望各位大虾指点迷津!