unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Sockets, StdCtrls;
type
DataThread=TClientDataThread.Create(self);
end;
type TForm1 = class(TForm)
Memo1: TMemo;
Label1: TLabel;
TcpServer1: TTcpServer;
procedure TcpServer1Accept(Sender: TObject;
ClientSocket: TCustomIpClient);
private
{ Private declarations }
public
{ Public declarations } end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.TcpServer1Accept(Sender: TObject;
ClientSocket: TCustomIpClient);
var
s:string; DataThread:TClientDataThread;
begin
DataThread:=TclientDataThread.Create(true);//生成线程对象
DataThread.TargetList:=memo1.Lines;
[Error] Unit1.pas(35): Undeclared identifier: 'TClientDataThread'怎么声明?在那个位置
DataThread:=TClientDataThread.Create(self);是不是这样放TYPE还是在自己建一个,怎么写刚学类声明。
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Sockets, StdCtrls;
type
DataThread=TClientDataThread.Create(self);
end;
type TForm1 = class(TForm)
Memo1: TMemo;
Label1: TLabel;
TcpServer1: TTcpServer;
procedure TcpServer1Accept(Sender: TObject;
ClientSocket: TCustomIpClient);
private
{ Private declarations }
public
{ Public declarations } end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.TcpServer1Accept(Sender: TObject;
ClientSocket: TCustomIpClient);
var
s:string; DataThread:TClientDataThread;
begin
DataThread:=TclientDataThread.Create(true);//生成线程对象
DataThread.TargetList:=memo1.Lines;
[Error] Unit1.pas(35): Undeclared identifier: 'TClientDataThread'怎么声明?在那个位置
DataThread:=TClientDataThread.Create(self);是不是这样放TYPE还是在自己建一个,怎么写刚学类声明。
TClientDataThread = class(TThread)
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Sockets, StdCtrls;
typeDataThread=TClientDataThread.Create(self);
end;
type TForm1 = class(TForm)
Memo1: TMemo;
Label1: TLabel;
TcpServer1: TTcpServer;
procedure TcpServer1Accept(Sender: TObject;
ClientSocket: TCustomIpClient);
private
{ Private declarations }
public
{ Public declarations } end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.TcpServer1Accept(Sender: TObject;
ClientSocket: TCustomIpClient);
var
s:string; DataThread:TClientDataThread;
begin
DataThread:=TclientDataThread.Create(true);//生成线程对象
DataThread.TargetList:=memo1.Lines; 搜索TClientDataThread相关单元,然后uses 单元名,就可以使用了。TclientDataThread不仅仅是声明那么简单,还需要具体的实现方法!