Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

program not responding

Status
Not open for further replies.

morfasie

IS-IT--Management
Mar 28, 2004
85
0
0
ZA
hi all,

I was just wondering? When you create an application that makes use of lets say a DB etc. You then open the application and it starts running, but if you open a normal window over your application, and you want to go back to your app, it is all white, or shows not responding, but it is still repsonding?

Could one overcome this with threads?

thanks
 
The VCL uses one thread (the so called main thread) to do all the interface work (receiving and processing signals and the like).

Simple applications uses the same thread to make they specific work (like opening dbases, crunching numbers, etc).

A thread can make only one thing at a given time, so if it is opening a dbase it can't process the Window signals (and it can't track the interface state), that is why the application appears as "frozen" (even if it is not).

To solve the problem, implement your time consuming tasks in another thread and let the main thread for the VCL only.

Entering a discussion about how to implement a multi-threaded application is far out the scope of any forum, but you can get very good material in the 'net. Google for "Delphi threads"

buho (A).


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top