Article View: borland.public.cppbuilder.nativeapi
Article #14642Re: Threads and Timer problem
From: Malcolm Smith
Date: Tue, 05 Aug 2003 14:59
Date: Tue, 05 Aug 2003 14:59
79 lines
3743 bytes
3743 bytes
I found my original source and it compiles fine under BCB5 and BCB6. The warning is due to me being lazy and leaving code in the header. If you move it to the .cpp file it will go away. If you want my source code (just in case it is different to the download) let me know and I'll send it along. -- Malcolm Smith MJ Freelancing- http://www.mjfreelancing.com Software Protection for C++Builder Borland Technology Partner "Paul E." <paulepst69@aol.com> wrote in message news:3f2e85b6@newsgroups.borland.com... > Thanks maclolm, well first of all I am really so *NEW* to Threads, and I am > not insisting on using Synchronize calls, I am open to any suggestions, > advise from anyone. > > My main task is that I have a few functions that must get executed every 5 > seconds, so I need to do this in a separate thread other than the main > project thread...so I really need help with how I can change the code I > posted to reach my main task... > > So if you can please let me know how I can adjust the code I posted to reach > my task... > > BTW I downloaded your tutorial, and it is really good, but a bit high on my > level in threads to understand, also it gives me 2 error when I try to run > the project... > > [C++ Warning] main.h(75): W8027 Functions containing while are not expanded > inline > [C++ Error] main.cpp(126): E2369 Cannot use the result of a property > assignment as an rvalue > > thanks for your support > > > "Malcolm Smith" <mjfreelancing@optusnet.com.au> wrote in message > news:3f2e41c5$1@newsgroups.borland.com... > > I forgot to mention, your code is no better than if you dropped a TTimer > on > > the form and made it active from the button click. Your methods are still > > processed within the context of the main VCL thread because of the > > Synchronize call. > > > > -- > > Malcolm Smith > > MJ Freelancing- http://www.mjfreelancing.com > > Software Protection for C++Builder > > Borland Technology Partner > > > > > > "Malcolm Smith" <mjfreelancing@optusnet.com.au> wrote in message > > news:3f2e415c$1@newsgroups.borland.com... > > > I'm not sure why you are triggering a TTimer this way. If you are after > a > > > thread that processes a task after a given period of time check out my > > > tutorials page. I have just the class for you. Look for > > TWaitEventThread. > > > > > > -- > > > Malcolm Smith > > > MJ Freelancing- http://www.mjfreelancing.com > > > Software Protection for C++Builder > > > Borland Technology Partner > > > > > > > > >
Technical Details
Message-ID:
<3f2fc52b@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!border3.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<3f2daa27@newsgroups.borland.com> <3f2e415c$1@newsgroups.borland.com> <3f2e41c5$1@newsgroups.borland.com> <3f2e85b6@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,ece7f64e3f770b72 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-08-05 08:00:03 PST Reply-To: "Malcolm Smith" <mjfreelancing@optusnet.com.au> From: "Malcolm Smith" <mjfreelancing@optusnet.com.au> Newsgroups: borland.public.cppbuilder.nativeapi References: <3f2daa27@newsgroups.borland.com> <3f2e415c$1@newsgroups.borland.com> <3f2e41c5$1@newsgroups.borland.com> <3f2e85b6@newsgroups.borland.com> Subject: Re: Threads and Timer problem Date: Wed, 6 Aug 2003 00:59:41 +1000 Lines: 81 Organization: MJ Freelancing X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 211.28.166.113 Message-ID: <3f2fc52b@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1060095275 211.28.166.113 (5 Aug 2003 07:54:35 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!border3.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail