-
December 2nd, 2002, 08:47 AM
#1
how to let a user interface thread to handle message
My program must handle the MM_WIM_DATA message which is sent from sound wave input device to indicate the record buffer is full.Originally I handled this message in a CDialog derived class,but the handler was called so frequantly that it jammed the response to button click,so I define a user interface thread derived from CWinThread to do this job.I have used waveInOpen API to let the wave input device send MM_WIM_DATA directly to the new thread,and I have used AfxBeginThread to start the thread,and I have used ON_THREAD_MESSAGE and afx_msg to define the handler in the new thread's cpp and header file.But the new thread seemed can't receive the MM_WIM_DATA message,why?!
-
December 2nd, 2002, 05:09 PM
#2
I would expect the message is being sent with a ::SendMessage(...) or a ::PostMessage(...). To send a message to a user interface thread, I believe the sender must use ::PostThreadMessage(...).
Regards
Robert Thompson
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
|