Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 May : Re: Can I call a procedure from OnExecute?

www.cryer.info
Managed Newsgroup Archive

Re: Can I call a procedure from OnExecute?

Subject:Re: Can I call a procedure from OnExecute?
Posted by:"PeaShooter_OMO" (jacquesv..@homemail.co.za)
Date:Fri, 12 May 2006 22:12:55

Thanks again

"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message
news:446221f2$1@newsgroups.borland.com...
>
> "PeaShooter_OMO" <jacquesvdm@homemail.co.za> wrote in message
> news:4461c6a9@newsgroups.borland.com...
>
>> Can I call a procedure directly from OnExecute
>
> Yes.
>
>> will that procedure be incorporated into the thread that the
>> client connection is in
>
> A procedure is always run in the context of the thread that is calling it.
> In this case, in the context of the thread that is triggering the
> OnExecute
> event handler.
>
>> must it be in a Synchronize() or does it depend on what is in
>> that procedure (for example using VCL) .
>
> It depends on what the procedure is actually doing.
>
>> Please consider the following:
>
> DoBlahBlah() is not a member of the form.  If DoBlahBlah() accesses the
> GUI,
> or other thread-unsafe items of the main thread, you wll not be able to
> use
> Synchronize() to call DoBlahBlah() directly, as Synchronize() only works
> with class methods.
>
>
> Gambit

Replies:

none

In response to:

www.cryer.info
Managed Newsgroup Archive