Newsgroups : Borland : borland.public.delphi.internet.winsock : 2005 Jul : Help : Simple PopUp Messaging

www.cryer.info
Managed Newsgroup Archive

Help : Simple PopUp Messaging

Subject:Help : Simple PopUp Messaging
Posted by:"michael" (mgoh_..@yahoo.co.uk)
Date:Sun, 3 Jul 2005 17:54:44

Dear All,

I wanted to do a popup messaging, like 'talk' in unix or icq

After the computer receive the connection, it will popup new form with Memo
Control inside to read or write

1. Using telnet to connect in, telnet freezes. Still Ok to type in but no
display in the telnet.
2. Why it/the application freezes ? after second connection

Thanks

Regards
Michael

--- the code --

TIdMyContext = class(TIdContext)
  public
    theForm : TForm2
  end;
end;

type
  TForm2 = class(TForm)
    Memo1: TMemo;
  end;
var
  Form2: TForm2;
end;

type
  TForm1 = class(TForm)
    IdTCPServer1: TIdTCPServer;
    IdAntiFreeze1: TIdAntiFreeze;
    Memo1: TMemo;
    Memo2: TMemo;
    procedure FormCreate(Sender: TObject);
    procedure IdTCPServer1Connect(AContext: TIdContext);
    procedure IdTCPServer1Execute(AContext: TIdContext);

var
  Form1: TForm1;

implementation

procedure TForm1.FormCreate(Sender: TObject);
begin
  IdTCPServer1.ContextClass := TIdMyContext;
end;

procedure TForm1.IdTCPServer1Connect(AContext: TIdContext);
var
  frmNew : TForm2;
begin
  Application.CreateForm(tform2,frmNew);
  TIdMyContext(acontext).theForm := frmNew
frmnew.visible := true;
end;

procedure TForm1.IdTCPServer1Execute(AContext: TIdContext);
begin
  with TIdMyContext(acontext) do
  begin
    theForm.memo1.Lines.Add(Connection.IOHandler.ReadLn);
  end;
end;

end.

Replies:

www.cryer.info
Managed Newsgroup Archive