> Thank Luke, I will give that a try. The only problem I have is that
> the error is happening after the forms onClose even completes. So I am
> not sure. If I stop using threads, all is well, but I can only accept
> one connection concurrently. That is bad :-( I will try what you
> have suggested, and see if I can come up with anything.
> I have included the key events in my prog, could someone just have a
> quick scan and confirm that everything is OK in it.
> Thanks
> Wes
> ** Not in any specific order **
> here is my OnAccept Event of TcpServer:
> procedure TForm2.TcpServerAccept(Sender: TObject;
> ClientSocket: TCustomIpClient);
> var
> txt: string;
> PopupAlertThread: TPopupAlertThread;
> begin
> // Read the first line from the incoming
> txt:= ClientSocket.Receiveln();
> // create alert popup thread
> PopupAlertThread := TPopupAlertThread.Create(true);
> If txt = 'BUY' then
> begin
> PopupAlertThread.AlertType := 'BUY';
> PopupAlertThread.AlertData := ClientSocket.Receiveln();
> txt:= ClientSocket.Receiveln();
> While txt <> '' do
> begin
> PopupAlertThread.AlertMessage.Append(s);
> txt := ClientSocket.Receiveln();
> end;
> end;
> // Call Resume which will execute and synch/perform the popup
> PopupAlertThread.Resume;
> end;
> Here is the thread declaration
> // Thread for Alert Popup
> TClientDataThread = class(TThread)
> private
> public
> AlertType, AlertData : String;
> AlertMessage : TStrings;
> procedure threadPopupAlertMessage;
> constructor Create(CreateSuspended: Boolean);
> procedure Execute; override;
> procedure Terminate;
> end;
> Here is the thread implementation
> //------------- BEGIN My Popup Thread -------------------------------
> constructor TPopupAlertThread.Create(CreateSuspended: Boolean);
> begin
> inherited Create(CreateSuspended);
> FreeOnTerminate := true;
> AlertMessage := TStringList.Create;
> end;
> procedure TPopupAlertThread.Terminate;
> begin
> AlertMessage.Free;
> inherited;
> end;
> procedure TPopupAlertThread.Execute;
> begin
> Synchronize(threadPopupAlertMessage);
> Self.FreeOnTerminate := True;
> Self.Free;
> If not Self.Terminated then Self.Terminate;
> end;
> procedure TPopupAlertThread.threadPopupAlertMessage;
> begin
> Form2.ShowAlert(AlertType, AlertData, AlertMessage);
> end;
> //------------- END My Popup Thread ---------------------------
> On Mon, 8 Jul 2002 17:36:33 -0700, "Luke Croteau [TriadNet Studios]"
> <lu...@triadnet.net> wrote:
> >Way to go not answering the question at all.
> >Wes,
> >Generally, when an error occurs outside the IDE and not inside, there is
> >usually a pointer or object that is being misused, or destroyed.
> >My advise would be to start using Try..Excepts to find exactly where the
> >problem occurs at, then analyzing what could be happening to that
variable.
> >-Luke
> >"Jason Southwell" <ja...@southwell.net> wrote in message
> >news:3D29F350.8090306@southwell.net...
> >> > my head. I am using the TcpServer and TcpClient controls from the
> >> > Internet tab in D6 Ent to create a Peer-to-Peer Alert System. In the
> >> Is there a reason you're not using the Indy Components for this?
> >> --
> >> Jason Southwell
> >> President & CEO
> >> Arcana Technologies