TBackgroundWorker and modal windows

Please post bug reports, feature requests, or any question regarding the DELPHI AREA projects here.

TBackgroundWorker and modal windows

Postby anom69 » January 21st, 2013, 2:18 pm

I have something like this:

Code: Select all
button click:
create window
execute thread
show window modal

window cancel button:
thread cancel

work event:
if cancellation pending then accept cancellation, display aborted and exit
execute slow function here


But this one can't display status aborted immediately, also after next button click component tell me that is already run.
How to fix it?

Also some cancel event or something similar will be nice, aren't they?
anom69
Member
Member
 
Posts: 2
Joined: January 21st, 2013, 2:08 pm

Re: TBackgroundWorker and modal windows

Postby Kambiz » January 22nd, 2013, 5:38 pm

The delay depends on the delay between the two consequent pending cancellation checks. In other words, it's just your code that defines how fast the thread should respond to a cancel request.
By the way, do not show the "aborted" message inside the thread. Generally all the UI interactions should be done in the main thread only.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Re: TBackgroundWorker and modal windows

Postby anom69 » January 24th, 2013, 2:17 pm

No, this is report feedback for event only ;)

Could you show me sample how to use your component with modal windows?
anom69
Member
Member
 
Posts: 2
Joined: January 21st, 2013, 2:08 pm

Re: TBackgroundWorker and modal windows

Postby Kambiz » January 24th, 2013, 5:00 pm

Please send me a sample program with that problem to me, so that I know exactly what are you going to do and apply the fix. It will also save a lot of my time.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm


Return to DELPHI AREA Projects

Who is online

Users browsing this forum: No registered users and 1 guest