CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2002
    Posts
    3

    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?!

  2. #2
    Join Date
    Oct 2002
    Posts
    1,134
    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
  •  





Click Here to Expand Forum to Full Width

Featured