X
xuyingfeng
Unregistered / Unconfirmed
GUEST, unregistred user!
编译时老师再有问题的那一行出现
[Error] ysbddl_Unit.pas(22): Unsatisfied forward or external declaration: 'Tysbddl_frm.CSktXOnConnect'
unit ysbddl_Unit;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ScktComp, StdCtrls, Buttons, ExtCtrls, Menus, CSkt;
type
Tysbddl_frm = class(TForm)
Panel1: TPanel;
Memo2: TMemo;
Panel2: TPanel;
BitBtn1: TBitBtn;
Memo1: TMemo;
ListBox1: TListBox;
MainMenu1: TMainMenu;
N1: TMenuItem;
N2: TMenuItem;
sskt1: TServerSocket;
ClientSocket1: TClientSocket;
有问题的行: procedure CSktXOnConnect(Sender: TObject;Socket: TCustomWinSocket);
procedure CSktXOnError(sender: TObject; Socket: TCustomWinSocket;ErrorEvent: TErrorEvent; var ErrorCode: Integer);
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
ysbddl_frm: Tysbddl_frm;
CSktX:array[0..299] of TClientSocket;
implementation
uses ysbddl_dm_Unit;
{$R *.DFM}
procedure Tysbddl_frm.BitBtn1Click(Sender: TObject);
var i:integer;
begin
i:=0;
with ysbddl_dm.ysbddl_spc1 do
begin
params[0].asstring:=memo2.text;
prepare;
execproc;
ysbddl_dm.ysbddl_spc1.close;
end;
with ysbddl_dm.computer_ip_qry do
begin
open;
first;
repeat
CSktx:=TClientSocket.create(self);
CSktx.OnConnect:=CSktXOnConnect;
CSktx.OnError:=CSktXOnError;
CSktx.address:=fieldbyname('cop_ip').asstring;
CSktx.Port:=75555;
CSktx.Active:=true;
i:=i+1;
next;
until eof;
end;
end;
procedure CSktOnConnect(Sender: TObject;Socket: TCustomWinSocket);
begin
socket.SendText('(^%^)start'+ysbddl_frm.memo2.text+'(^%^)end');
ysbddl_frm.memo1.lines.add(socket.remoteaddress+'在"'+socket.RemoteHost+'"上的计算机已经接收到调令');
end;
procedure CSktOnError(sender: TObject; Socket: TCustomWinSocket;ErrorEvent: TErrorEvent; var ErrorCode: Integer);
begin
errorcode:=0;
//ysbddl_frm.memo1.lines.add(address+'在"'+Host+'"上的计算机没有接收到调令');
end;
end.
[Error] ysbddl_Unit.pas(22): Unsatisfied forward or external declaration: 'Tysbddl_frm.CSktXOnConnect'
unit ysbddl_Unit;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ScktComp, StdCtrls, Buttons, ExtCtrls, Menus, CSkt;
type
Tysbddl_frm = class(TForm)
Panel1: TPanel;
Memo2: TMemo;
Panel2: TPanel;
BitBtn1: TBitBtn;
Memo1: TMemo;
ListBox1: TListBox;
MainMenu1: TMainMenu;
N1: TMenuItem;
N2: TMenuItem;
sskt1: TServerSocket;
ClientSocket1: TClientSocket;
有问题的行: procedure CSktXOnConnect(Sender: TObject;Socket: TCustomWinSocket);
procedure CSktXOnError(sender: TObject; Socket: TCustomWinSocket;ErrorEvent: TErrorEvent; var ErrorCode: Integer);
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
ysbddl_frm: Tysbddl_frm;
CSktX:array[0..299] of TClientSocket;
implementation
uses ysbddl_dm_Unit;
{$R *.DFM}
procedure Tysbddl_frm.BitBtn1Click(Sender: TObject);
var i:integer;
begin
i:=0;
with ysbddl_dm.ysbddl_spc1 do
begin
params[0].asstring:=memo2.text;
prepare;
execproc;
ysbddl_dm.ysbddl_spc1.close;
end;
with ysbddl_dm.computer_ip_qry do
begin
open;
first;
repeat
CSktx:=TClientSocket.create(self);
CSktx.OnConnect:=CSktXOnConnect;
CSktx.OnError:=CSktXOnError;
CSktx.address:=fieldbyname('cop_ip').asstring;
CSktx.Port:=75555;
CSktx.Active:=true;
i:=i+1;
next;
until eof;
end;
end;
procedure CSktOnConnect(Sender: TObject;Socket: TCustomWinSocket);
begin
socket.SendText('(^%^)start'+ysbddl_frm.memo2.text+'(^%^)end');
ysbddl_frm.memo1.lines.add(socket.remoteaddress+'在"'+socket.RemoteHost+'"上的计算机已经接收到调令');
end;
procedure CSktOnError(sender: TObject; Socket: TCustomWinSocket;ErrorEvent: TErrorEvent; var ErrorCode: Integer);
begin
errorcode:=0;
//ysbddl_frm.memo1.lines.add(address+'在"'+Host+'"上的计算机没有接收到调令');
end;
end.