可是在DLL里, 用个FORM, 加个TCPSERVER, 为何就不能响应客户端的连接呢?
library Project1;
{$R *.res}
uses
dllUnit in 'dllUnit.pas' {Form1};
begin
end.
unit dllUnit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Sockets;
type
TForm1 = class(TForm)
s: TTcpServer;
procedure sAccept(Sender: TObject; ClientSocket: TCustomIpClient);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.sAccept(Sender: TObject; ClientSocket: TCustomIpClient);
var f:textfile;
begin
assignfile(f,'c:/a.txt');
rewrite(f);
writeln(f,'aaaa');
closefile(f);
end;
把sAccept的代码写入到TForm1.FormCreate里, 也没用, 不在C盘下生成a.txt文件. 为什么呀?