Thread and ON_WM_TIMER
-
Hi I need to manage a progressBar into MyThread class(CWinThread derived) using a timer but I can use the ON_WM_TIMER Event message. How can I do it? Using the SetTimer function but how? Thanks
-
Hi I need to manage a progressBar into MyThread class(CWinThread derived) using a timer but I can use the ON_WM_TIMER Event message. How can I do it? Using the SetTimer function but how? Thanks
CDRAIN wrote:
Hi I need to manage a progressBar into MyThread class(CWinThread derived)...
Does the progress bar belong to a different thread than the one you are creating?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
CDRAIN wrote:
Hi I need to manage a progressBar into MyThread class(CWinThread derived)...
Does the progress bar belong to a different thread than the one you are creating?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
CDRAIN wrote:
How can I do it? Using the SetTimer function but how?
They hide that information in the Documentation[^]
led mike
-
Yes, the progress bar belong to the MainThread of my Application, and I need to manage it from my thread.
CDRAIN wrote:
Yes, the progress bar belong to the MainThread of my Application, and I need to manage it from my thread.
Which is a sure-fire recipe for disaster.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
Yes, the progress bar belong to the MainThread of my Application, and I need to manage it from my thread.
CDRAIN wrote:
the progress bar belong to the MainThread of my Application, and I need to manage it from my thread.
in your first post you said
CDRAIN wrote:
I need to manage a progressBar into MyThread class
I have no idea what to believe at this point. If your progress bar is in the main thread you DO NOT need to manage it from the worker thread. Instead you do something like this: Progress Information Object CWnd in main thread (Progress Bar or Window) has a reference to the Progress Information Object CWinThread worker thread has a reference to the Progress Information Object and continuously updates the object to reflect the work in progress. ProgressBar or Window sets a timer and on the timer event reads the progress information from the shared Progress Information Object and updates the ProgressBar state.
led mike