Article View: borland.public.cppbuilder.nativeapi
Article #14104Re: Calling a function from ServiceExecute.
From: MWP
Date: Wed, 27 Aug 2003 04:34
Date: Wed, 27 Aug 2003 04:34
64 lines
2776 bytes
2776 bytes
Your a legend...
Thanks for that Remy.
"Remy Lebeau \(TeamB\)" <gambit47@yahoo.com> wrote:
>
>"MWP" <mwp@overclockers.com.au> wrote in message
>news:3f4b8e1f$1@newsgroups.borland.com...
>
>> void execute_cc2(bool *Terminated, TServiceThread *Thread)
>> {
>> while (!*Terminated)
>> {
>> //does stuff
>> Sleep(10);
>> Thread->ProcessRequests(false)
>> }
>> }
>
>That will not work. You should change the Terminated parameter to take a
>TService* pointer instead of a bool* pointer:
>
> void execute_cc2(TService *Service, TServiceThread *Thread)
> {
> while( !Service->Terminated )
> {
> //does stuff
> Sleep(10);
> Thread->ProcessRequests(false);
> }
> }
>
>Even better, since TService has a public ServiceThread property, you can do
>away with execute_cc2's Thread parameter altogether:
>
> void execute_cc2(TService *Service)
> {
> while( !Service->Terminated )
> {
> //does stuff
> Sleep(10);
> Service->ServiceThread->ProcessRequests(false);
> }
> }
>
>> BTW... whats the difference between a "Property" and a variable then?
>
>A property is not a variable. It may happen to use a variable internally,
>but it is actually a couple of getter/setter methods instead that perform
>operations when invoked. A variable is just a block of memory. In your
>original code, you were trying to take an address of a class method, not a
>raw variable.
>
>
>Gambit
>
>
>---
>Outgoing mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.512 / Virus Database: 309 - Release Date: 8/19/03
>
>
Technical Details
Message-ID:
<3f4c34e6$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-05!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3f4b40bb$1@newsgroups.borland.com> <3f4b87cd@newsgroups.borland.com> <3f4b8e1f$1@newsgroups.borland.com> <3f4bae6c$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,cccee033616271b2 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-08-26 21:36:18 PST From: "MWP" <mwp@overclockers.com.au> Sender: "MWP" <mwp@overclockers.com.au> Reply-To: "MWP" <mwp@overclockers.com.au> Subject: Re: Calling a function from ServiceExecute. Newsgroups: borland.public.cppbuilder.nativeapi X-User-Info: 203.166.107.242 203.166.107.242 X-Forwarded-For: unknown References: <3f4b40bb$1@newsgroups.borland.com> <3f4b87cd@newsgroups.borland.com> <3f4b8e1f$1@newsgroups.borland.com> <3f4bae6c$1@newsgroups.borland.com> NNTP-Posting-Host: 207.105.83.65 Message-ID: <3f4c34e6$1@newsgroups.borland.com> Date: 26 Aug 2003 21:34:46 -0700 X-Trace: newsgroups.borland.com 1061958886 207.105.83.65 (26 Aug 2003 21:34:46 -0700) Lines: 65 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-05!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail