Re: BN_CLICKED Event Handler in Background
Hi Newbie,
See below:
Tom
<vv_ramana@yahoo.com> wrote in message
news:1181564648.452917.42800@q69g2000hsb.googlegroups.com...
Thanks. So far so good. I made some good progress yesterday. However,
I have couple of questions and need you expertise.
1. How do we make the "Worker Thread" to do the operation every 1
minute (I.e. Add Delay or Sleep).
Use Sleep() in your while loop in the main thread code.
2. When this operation is running in the background, the user should
not be allowed to logout.
How can I show a message box (just like MessageBox or
AfxMessageBox) which will keep checking the
the progress of the background operation and close the dialog
itself once done and proceed with the logout?
I'd do this in the logout routine. If you have a flag that indicates that
the thread is running you could check that and then tell the user it's not a
good time to log out. You could also give them the opportunity to cancel
the thread at that time which you'd do by setting a flag in the thread that
tells it to exit. I'd probably do a Wait or Abort type message in the
logout routine.
Thanking you in advance.
- Newbie