Article View: borland.public.cppbuilder.nativeapi
Article #14032TThread can't be Resumed when the application is not Active (focused)?
From: Phuoc Can HUA
Date: Sat, 06 Sep 2003 01:09
Date: Sat, 06 Sep 2003 01:09
43 lines
1918 bytes
1918 bytes
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:
<opru1z6kriypkypy@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!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,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-09-05 18:11:21 PST
Date: Sat, 06 Sep 2003 11:09:46 +1000
Subject: TThread can't be Resumed when the application is not Active (focused)?
Newsgroups: borland.public.cppbuilder.nativeapi
Content-Type: text/plain; charset=iso-8859-15; format=flowed
From: Phuoc Can HUA <home}-a-t-{huaonline-dot}com>
MIME-Version: 1.0
Message-ID: <opru1z6kriypkypy@newsgroups.borland.com>
User-Agent: Opera7.10/Win32 M2 build 2840
NNTP-Posting-Host: 203.213.56.135
X-Trace: newsgroups.borland.com 1062810557 203.213.56.135 (5 Sep 2003 18:09:17 -0700)
Lines: 43
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail