在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type Test=record a: Integer; b: Integer; end; TForm1 = class(TForm) btn1: TButton; memo1: TMemo; procedure btn1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; function MyThreadFun(var Param: Test): Integer; stdcall; //注,此行写成TForm1.MyThreadFun Createthread调用处会报错。 implementation uses Unit2; {$R *.dfm} function MyThreadFun(var Param: Test): Integer; stdcall; begin Form1.Memo1.Text := IntToStr(Param.a); Result := 0; end; procedure TForm1.btn1Click(Sender: TObject); var Id: Dword; P: test; begin p.a:=5; Createthread(nil, 0, @MyThreadFun, @p, 0, Id); end;
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论