tcp socket으로 connect되면 새로운 폼을 열려고 하는데
새로운 폼이 열리지가 않네요...
어떻게 해야 할지...
그런데 버튼에서 클릭하면 폼이 잘 열리거든요.
답변 부탁드립니다.
========================================== server ================
unit winopen;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, RxRichEd, IdThreadMgr, IdThreadMgrDefault, IdBaseComponent,
IdComponent, IdTCPServer, IdTCPConnection, IdTCPClient,
;
type
TFWinOpen = class(TForm)
Button1: TButton;
TCPServer: TIdTCPServer;
IdThreadMgrDefault1: TIdThreadMgrDefault;
mess: TRxRichEdit;
procedure Button1Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure TCPServerConnect(AThread: TIdPeerThread);
procedure TCPServerDisconnect(AThread: TIdPeerThread);
procedure TCPServerException(AThread: TIdPeerThread;
AException: Exception);
procedure TCPServerExecute(AThread: TIdPeerThread);
private
{ Private declarations }
procedure SubWinOpen;
public
{ Public declarations }
end;
var
FWinOpen: TFWinOpen;
implementation
uses
winopen_sub;
{$R *.DFM}
procedure TFWinOpen.Button1Click(Sender: TObject);
begin
SubWinOpen;
end;
procedure TFWinOpen.SubWinOpen;
var
OpenWin: TFWinOpenSub;
begin
Inc(WinCnt);
OpenWin := nil;
OpenWin := TFWinOpenSub.Create(Self);
OpenWin.Caption := 'Open : ' + IntToStr(WinCnt);
OpenWin.Show;
end;
procedure TFWinOpen.TCPServerConnect(AThread: TIdPeerThread);
begin
mess.lines.add('Server Connect');
SubWinOpen;
end;
procedure TFWinOpen.TCPServerExecute(AThread: TIdPeerThread);
begin
if not AThread.Terminated and AThread.Connection.Connected then
begin
AThread.Connection.Disconnect;
end;
end;
end.