🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #13989

Re: How to Trigger the Main Program from a Timer Procedure?

#13989
From: Bob Gonder
Date: Mon, 01 Sep 2003 20:56
21 lines
1991 bytes
Remy Lebeau (TeamB) wrote:

>
>"Phuoc Can HUA" <home}a+t{huaonline.com> wrote in message
>news:oprus769kobq7az6@newsgroups.borland.com...
>
>> How can the timer 'tell' the main program that next file
>> has to be loaded? Since the loading of a file could take
>> relatively long or even error, so that I don't want to put
>> it into the timer procedure.
>
>Move the loading code into a separate thread instead.  Either pass the
>thread an array of filenames to load in a loop, or else have the thread load
>a single file and then use its OnTerminate event (assuming you use TThread)
>to start the next file loading thread.

Or, if you really need to use the timer method you have a couple of
choices.
1) The timer triggers an event that the LoadFile thread is waiting on.
2) The timer starts the LoadFile thread which self-terminates.
3) The timer does SendMessage to the main program.
Technical Details
Message-ID: <i7c7lv4b1hb6f6k5upe6qsv718q7qi1jth@4ax.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <oprus769kobq7az6@newsgroups.borland.com> <3f53a731$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,e4cd861378e7d24
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-09-01 14:05:44 PST
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: How to Trigger the Main Program from a Timer Procedure?
Date: Mon, 01 Sep 2003 13:56:32 -0700
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <i7c7lv4b1hb6f6k5upe6qsv718q7qi1jth@4ax.com>
References: <oprus769kobq7az6@newsgroups.borland.com> <3f53a731$1@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.91/32.564
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 67.31.164.39
X-Trace: newsgroups.borland.com 1062449800 67.31.164.39 (1 Sep 2003 13:56:40 -0700)
Lines: 24
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail