请教,IntraWEB的线程问题

xwm21cn 2003-10-20 05:48:28
在使用INTRAWEB的多线程时,如下编码中,预期
QueryForm.IWLabel1.Caption := 'test';
但界面并没有打印出'test',不知需要怎样处理,才能得到预期结果?
注:如果连续提交,偶尔会得到结果,但测试,绝大多时间,该值并不出现在界面上。

TClientThread = class(TThread)
private
sBuffer: BufferType;
// Private declarations
protected
procedure GiveAnswer;
public
procedure Execute; override;
constructor Create(AQueryForm: TFormMain);
end;

constructor TClientThread.Create(AQueryForm: TFormMain);
begin
QueryForm := AQueryForm;
inherited Create(False);
end;

procedure TClientThread.GiveAnswer;
begin
QueryForm.IWTimerSubmit.Enabled := false;
QueryForm.IWLabel1.Caption := 'test';
end;


Procedure TClientThread.Execute;
begin
FreeOnTerminate := True;
Priority := tpNormal;
While (not Terminated) do
begin
Synchronize(GiveAnswer);
end;
end;


...全文
36 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
alec_ma 2003-10-21
  • 打赏
  • 举报
回复
ssss
ziqing 2003-10-21
  • 打赏
  • 举报
回复
UP!!
xwm21cn 2003-10-21
  • 打赏
  • 举报
回复
我的MSN(E-MAIL):xwm21cn@hotmail.com
请不吝指导

5,386

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧