09-13-2005 07:06 PM
http://en.wikipedia.org/wiki/Thread_%28computer_science%29
states:
A common use of threads is having one thread paying attention to the graphical user interface, while others do a long calculation in the background. As a result, the application more readily responds to user's interaction.
What this suggests to me is the following:09-14-2005 03:13 AM
I would suggest you to use PostDeferredCalltoThread () function.
You must define a deferred callback to stop the download and call it with PostDefferredCallToThread from the main thread. Inside the function that executes the download you must insert a GetUserEvents () or ProcessSystemEvents () to let the deferred function to execute.
09-14-2005 09:30 AM
09-23-2005 06:54 AM
A simple way of doing this is simply to set a global variable TRUE when the user opts to abort the download. Your secondary thread which is doing the download continuously checks the state of this flag while it is executing and if it finds it is set, it takes whatever steps are necessary to perform a controlled abort, before finally unsettting the flag and then terminating.
Jamie