Click here to Skip to main content
16,016,306 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionI am Geting a Problem in GetSafeHwnd() Pin
GangaSungar19-Aug-08 18:47
GangaSungar19-Aug-08 18:47 
AnswerRe: I am Geting a Problem in GetSafeHwnd() Pin
Nibu babu thomas19-Aug-08 19:32
Nibu babu thomas19-Aug-08 19:32 
Questionrun a thread Pin
anilaabc19-Aug-08 18:21
anilaabc19-Aug-08 18:21 
AnswerRe: run a thread Pin
ptr_Electron19-Aug-08 19:13
ptr_Electron19-Aug-08 19:13 
GeneralRe: run a thread Pin
anilaabc19-Aug-08 21:32
anilaabc19-Aug-08 21:32 
AnswerRe: run a thread Pin
Cedric Moonen19-Aug-08 20:48
Cedric Moonen19-Aug-08 20:48 
GeneralRe: run a thread Pin
anilaabc19-Aug-08 22:00
anilaabc19-Aug-08 22:00 
AnswerRe: run a thread Pin
Roger Stoltz19-Aug-08 21:35
Roger Stoltz19-Aug-08 21:35 
anilaabc wrote:
sleep for fix interval


Well, Windows is not a real-time operating system. So depending on what kind of accuracy you need, this may or may not be possible in a windows environment.
See here[^] for more info.

Calling ::Sleep() is almost always wrong.
See here[^] for more info.

I suggest you create a waitable timer, ::CreateWaitableTimer(), that your thread can wait on with ::WaitForMultipleObjects(). To get the best accuracy you can use the multimedia timers, ::timeSetEvent() and so on, and set it up to signal an event you've created that you can wait on with ::WaitForMultipleObjects().

For more info on how to create and shut down the thread properly, and how to wait on synchronization objects inside the thread, see here[^].


"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown


GeneralRe: run a thread Pin
anilaabc19-Aug-08 22:15
anilaabc19-Aug-08 22:15 
QuestionHow can i configure visual studio to use _beginthreadex Pin
SNArruda19-Aug-08 15:29
SNArruda19-Aug-08 15:29 
AnswerRe: How can i configure visual studio to use _beginthreadex Pin
Stephen Hewitt19-Aug-08 15:31
Stephen Hewitt19-Aug-08 15:31 
GeneralRe: How can i configure visual studio to use _beginthreadex Pin
SNArruda19-Aug-08 15:35
SNArruda19-Aug-08 15:35 
AnswerRe: How can i configure visual studio to use _beginthreadex Pin
SNArruda19-Aug-08 16:27
SNArruda19-Aug-08 16:27 
GeneralRe: How can i configure visual studio to use _beginthreadex Pin
Jijo.Raj19-Aug-08 18:19
Jijo.Raj19-Aug-08 18:19 
QuestionHow to place the generated exe(dialogbox) exactly at the center of the desktop... Pin
hariakuthota19-Aug-08 8:35
hariakuthota19-Aug-08 8:35 
AnswerRe: How to place the generated exe(dialogbox) exactly at the center of the desktop... Pin
led mike19-Aug-08 8:52
led mike19-Aug-08 8:52 
AnswerRe: How to place the generated exe(dialogbox) exactly at the center of the desktop... Pin
Jijo.Raj19-Aug-08 8:52
Jijo.Raj19-Aug-08 8:52 
AnswerRe: How to place the generated exe(dialogbox) exactly at the center of the desktop... Pin
Perspx19-Aug-08 8:55
Perspx19-Aug-08 8:55 
AnswerRe: How to place the generated exe(dialogbox) exactly at the center of the desktop... Pin
Mark Salsbery19-Aug-08 8:58
Mark Salsbery19-Aug-08 8:58 
GeneralRe: How to place the generated exe(dialogbox) exactly at the center of the desktop... [modified] Pin
Nibu babu thomas19-Aug-08 16:45
Nibu babu thomas19-Aug-08 16:45 
GeneralRe: How to place the generated exe(dialogbox) exactly at the center of the desktop... Pin
Mark Salsbery20-Aug-08 5:10
Mark Salsbery20-Aug-08 5:10 
QuestionLive Messenger Pin
Nathan Going19-Aug-08 7:13
Nathan Going19-Aug-08 7:13 
AnswerRe: Live Messenger Pin
Perspx19-Aug-08 8:08
Perspx19-Aug-08 8:08 
GeneralRe: Live Messenger Pin
led mike19-Aug-08 8:29
led mike19-Aug-08 8:29 
JokeRe: Live Messenger Pin
Perspx19-Aug-08 8:45
Perspx19-Aug-08 8:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.