From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ce290b2dd8bc80e8 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!out04a.usenetserver.com!news.usenetserver.com!in04.usenetserver.com!news.usenetserver.com!uns-out.usenetserver.com!news.usenetserver.com!pc03.usenetserver.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Need info about Ada tasks References: <1r3nd4190fqnicb4tdebo1ctt70cjetnhi@4ax.com> From: Stephen Leake Date: Fri, 26 Sep 2008 06:21:54 -0400 Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (windows-nt) Cancel-Lock: sha1:yOMvPfcutXs4+K1CImjhI+KUgmw= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: ad36048dca148c74cf41810033 Xref: g2news2.google.com comp.lang.ada:7826 Date: 2008-09-26T06:21:54-04:00 List-Id: Fionn Mac Cumhaill writes: > I am using the MingW Ada compiler and the GWindows packages on Windows > XP. > > I am writing a simple program which observes a table in SQL Server > 2000 and lists its rows to a visible screen display. I need a simple > task structure that can update the display periodically, with a > specified wait time between updates. I need to be able to abort the > display task at any time when the display is not being updated. Mixing tasking and GUI events can be problematic; only one thread can call GUI functions. The canonical solution to your problem is to use a Win32 timer, and update the display in the timer event handler function. Then "abort the display task" becomes "disable the timer". Although Dmitry solved your immediate problem, it might be better to use a different example problem to study tasking. -- -- Stephe