workthread.pas.~5~
来自「自助公交信息短信服务平台」· ~5~ 代码 · 共 62 行
~5~
62 行
unit workthread;
interface
uses
Classes,Messages;
type
//发送线程
TWorkThread = class(TThread)
private
{ Private declarations }
procedure ManagerDev; // the gate for the whole thread
//to send msg
procedure Workt; //to receive msg
protected
procedure Execute; override; //重载执行函数
// procedure Create;override;
public
// constructor create;
end;
var
recvcounts:integer;
Sendcounts:integer;
TestFlag:Boolean;
implementation
uses
SysUtils,calldll, mainProfile;
{ Important: Methods and properties of objects in VCL or CLX can only be used
in a method called using Synchronize, for example,
Synchronize(UpdateCaption);
and UpdateCaption could look like,
procedure TSendThread.UpdateCaption;
begin
Form1.Caption := 'Updated in a thread';
end; }
{ TSendThread }
procedure TWorkThread.ManagerDev; //system para
begin
TestFlag:=true;
while TestFlag=true do
begin
Workt;
end;
//SendMsg; //first test receive thread
end;
procedure TWorkThread.Workt;
begin
Form1.transgrid32grd1;
end;
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?