线程问题,很郁闷!

glmis 2003-12-02 04:24:04
unit Unit2;

interface

uses
Classes,Windows, SysUtils;

type
TestThrd = class(TThread)
private
{ Private declarations }
i : integer;
protected
procedure Execute; override;
public
constructor Create(b : boolean);overload;
destructor Destroy;overload;
end;

implementation

constructor TestThrd.Create(b: boolean);
begin
//--出错 为什么?
inherited Create(b);
end;
destructor TestThrd.Destroy;
begin
inherited Destroy;
end;

procedure TestThrd.Execute;
begin
{ Place thread code here }
MessageBox(0,PChar('线程已经运行'),'消息',MB_OK);
end;

end.
====================================================================
为什么 inherited Create 处就出错呢?
...全文
34 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
Xleep 2003-12-03
  • 打赏
  • 举报
回复
好像不会吧,出什么错?
citytramper 2003-12-03
  • 打赏
  • 举报
回复
constructor TestThrd.Create(b: boolean);
begin
//--出错 为什么?
inherited Create(b);
end;

一般 inherited Create(b) 要放在第一行

mistjin 2003-12-03
  • 打赏
  • 举报
回复
顶楼上
outer2000 2003-12-03
  • 打赏
  • 举报
回复
constructor Create(b : boolean);override;

1,183

社区成员

发帖
与我相关
我的任务
社区描述
Delphi Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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