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:"Remy Lebeau (TeamB)" (no.spam@no.spam.com)
Date:Wed, 10 May 2006 10:22:53

"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:

In response to:

www.cryer.info
Managed Newsgroup Archive