Does that mean I have to explicitly send either WM_CLOSE_SESSION or WM_QUIT
to the thread or does that happen automatically?

Phil.
----- Original Message ----- 
From: "Myles Penlington" <[EMAIL PROTECTED]>
To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
Sent: Tuesday, September 02, 2003 5:21 PM
Subject: RE: [DUG]: INDY Telnet


> In this case it may be easiest to run the indy components in their own
> thread. Otherwise you would somehow have to hook the parent applications
> message loop.
>
> Look at TApplication.ProcessMessage etc for a message loop, however for
your
> own thread, you don't need all the extra baggage that is present in the
> TApplication message loop.
>
> e.g. An example of a simple message loop I use in TThread.Execute
>
>       while not Terminated do begin                             //This is
> just to wait around and process the messages when they are required.
>         try                                                     //Sleep
all
> day and then do something occassionally.
>           if (MsgWaitForMultipleObjects( 1, WaitHandle, False, DeadTime,
> QS_ALLINPUT) = WAIT_TIMEOUT) then Terminate
>           else begin
>             while PeekMessage(Msg, 0, 0, 0, PM_REMOVE) do begin
>               if (Msg.Message = WM_CLOSE_SESSION)
>               or (Msg.Message = WM_QUIT) then Terminate
>               else begin
>                 TranslateMessage(Msg);
>                 DispatchMessage(Msg);
>               end;
>             end;
>           end;
>         except
> //Report issue?
>         end;
>       end;
>
> Myles.
>
> -----Original Message-----
> From: Phil Middlemiss [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, 2 September 2003 16:49
> To: Multiple recipients of list delphi
> Subject: Re: [DUG]: INDY Telnet
>
>
> I'm not explicitly using threads, but the Indy components are generally
> threaded. How do I go about using a message loop/pump?
> ----- Original Message ----- 
> From: "Myles Penlington" <[EMAIL PROTECTED]>
> To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
> Sent: Tuesday, September 02, 2003 4:35 PM
> Subject: RE: [DUG]: INDY Telnet
>
>
> > You may need a message loop/message pump on the thread being used.
> > Myles.
> >
> > -----Original Message-----
> > From: Phil Middlemiss [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, 2 September 2003 16:16
> > To: Multiple recipients of list delphi
> > Subject: [DUG]: INDY Telnet
> >
> >
> > I'm trying to use the Indy Telnet component from inside a DLL without
> > success. I get the status messages alright, but the OnDataAvailable
event
> > never fires (fires correctly when the component is in the main exe).
> >
> > Does anyone know a way around this?
> >
> > Phil.
> >
> >
>
> --------------------------------------------------------------------------
> -
> >     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
> >                   Website: http://www.delphi.org.nz
> > To UnSub, send email to: [EMAIL PROTECTED]
> > with body of "unsubscribe delphi"
> > Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
>
> --------------------------------------------------------------------------
> -
> >     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
> >                   Website: http://www.delphi.org.nz
> > To UnSub, send email to: [EMAIL PROTECTED]
> > with body of "unsubscribe delphi"
> > Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
> >
>
>
> --------------------------------------------------------------------------
-
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
> Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
> --------------------------------------------------------------------------
-
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
> Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
>


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to