R
raphtee
This is probably a simple/stupid question, but...
I have an MDI application which has a socket receiving data. When the
data is received it is displayed in some way. Sometimes the data that
is received is new and sometimes it is just an update. If something
in the document hasn't been updated in awhile it needs to be removed
and the view updated to reflect this. I decided to have a timer
thread. A worker thread that sits there and every second checks all
the data and any thing that has been there ahile it discards. Easy.
But Now after it has discarded it it needs to update the view
(Actually call UpdateAllviews() ). Of course a worker thread just
can't call UpdateAllViews(). So I need the thread to post a message.
The books I have require that the way this is done is to call
:ostMessage(hWnd, WM_USERMESSAGE, wParam, lParam) and the examples
all have the message handler in the CView class to which the hWnd
refers to an instance of. So now I am just doing that and having the
handler in the View class call the UpdateAllViews() which works,
but.... Isn't there a better way?? Can't I post a message directly
to the Documentclass and have a handler there take care of it??
raphtee
I have an MDI application which has a socket receiving data. When the
data is received it is displayed in some way. Sometimes the data that
is received is new and sometimes it is just an update. If something
in the document hasn't been updated in awhile it needs to be removed
and the view updated to reflect this. I decided to have a timer
thread. A worker thread that sits there and every second checks all
the data and any thing that has been there ahile it discards. Easy.
But Now after it has discarded it it needs to update the view
(Actually call UpdateAllviews() ). Of course a worker thread just
can't call UpdateAllViews(). So I need the thread to post a message.
The books I have require that the way this is done is to call
:ostMessage(hWnd, WM_USERMESSAGE, wParam, lParam) and the examples
all have the message handler in the CView class to which the hWnd
refers to an instance of. So now I am just doing that and having the
handler in the View class call the UpdateAllViews() which works,
but.... Isn't there a better way?? Can't I post a message directly
to the Documentclass and have a handler there take care of it??
raphtee