|
-
April 8th, 1999, 11:04 AM
#1
Sleep or SleepEx
trying to get a dialog based app ( vc++5) to pause for a set ammount of time ( pause for 60 secs.. then do something..)
and i use 'SleepEx(60000);' and get an error.I was told to use 'DWORD SleepEx(60000);' and no pause takes effect... any thing else I can use?
-
March 12th, 2005, 06:48 PM
#2
Re: Sleep or SleepEx
If you intend on using SleepEx, I would suggest setting the second argument of the SleepEx function (BOOL bAlertable) to FALSE to guarantee that the function willl not return until the time-out period has elapsed; however, I would imagine that the traditional Sleep function would work for most general purposes.
-
March 12th, 2005, 07:34 PM
#3
Re: Sleep or SleepEx
Why do you want your user interface to pause for a minute ?
As a guess you're using threads... and assuming that a thread will finish after
a minute has gone by.
Anyway, use Sleep instead of SleepEx. This'll have the desired effect.
Darwen.
-
March 13th, 2005, 02:42 PM
#4
Re: Sleep or SleepEx
If you are using Sleep in a main thread, all window message processing including GUI update will be freeze.
After trying to press button for couple of times while timeout is in effect, user may just call Task Manager and kill process thinking window hung.
If you do it trying to synchronize threads, Sleep is not a good idea; use Event or Mutex or any thread synchronization method.
There are only 10 types of people in the world:
Those who understand binary and those who do not.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|