I'm making an application that's making some reports from a FoxPro database (Query). Five separate statistics are involved. I want my user to be able to hit the Cancel button while processing the data, so I guess I need a thread here.
My question is twofold:
A) Can I (using threads) process the 5 processes at the same time?
B) How can I kill all threads at work to stop when my user hits the Cancel button.
What I have now is one thread, which defines an array of five threads, each processing another statistic. However, I have to WaitFor all these threads to end before I can show the result. When I use the WaitFor procedure, the application won't react on my Cancel button...
Can anybody give me an example of how I can do this?