Article View: borland.public.cppbuilder.nativeapi
Article #14035TThread can't be Resumed when the application is not Active (focused)?
From: Phuoc Can HUA
Date: Sat, 06 Sep 2003 13:05
Date: Sat, 06 Sep 2003 13:05
47 lines
2044 bytes
2044 bytes
For some reasons I couldn't find my posting. If you see this twice sorry
about that.
------------------------------------------
My program using object of a class like this:
MyClass::MyClass( String FileName): TThread
{
// Load data from a file
...
Resume();
while( !Suspended)
Sleep(1);
}
MyClass::Execute()
{
// some variables initialation
Suspend(); // Will be resumed from main
while( Terminate)
{
...
Suspend(); // Will be resumed from main
...
}
}
------------------------
After the data has been processed the object is deleted and initiate a new
one with another file.
Everything is running perfectly. But if I focus another application window
the program will be hanging
at the while(!Suspended) loop. Based on my investigation, it looks like the
thread is not running
into the Execute at all. So that I will never receive the Suspended= true.
Is it true that Execute is not resumed while the application is not active?
and how can I make it running even when the window is in the background?
thanks
Phuoc Can HUA
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Technical Details
Message-ID:
<opru2xargeypkypy@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-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,453649a6bac9d07b
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-09-06 06:07:37 PST
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: TThread can't be Resumed when the application is not Active (focused)?
Message-ID: <opru2xargeypkypy@newsgroups.borland.com>
Content-Type: text/plain; charset=iso-8859-15; format=flowed
From: Phuoc Can HUA <home}-a-t-{huaonline-dot}com>
MIME-Version: 1.0
Date: Sat, 06 Sep 2003 23:05:05 +1000
User-Agent: Opera7.10/Win32 M2 build 2840
NNTP-Posting-Host: 203.213.53.98
X-Trace: newsgroups.borland.com 1062853479 203.213.53.98 (6 Sep 2003 06:04:39 -0700)
Lines: 47
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail