I gave up on trying to create a message queue in an MFC worker thread by calling PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE); There is a good article by Joseph M. Newcomer titled "Using User-Interface Threads" which describes what I wanted to do using UI Threads. I still would like to know why i can't create the message queue, though! -Kevin
Kevin Behilo
Posts
-
MFC worker thread and message Queues -
MFC worker thread and message QueuesI figured out why the GUI was hanging. A mistake not related to the Message Queue. But I still can't get the Message Q to work. Is there any reason why the scheme in my first post would not work? Is the thread ID that I get from the CWinThread valid to use in: PostThreadMessage(pThread->m_nThreadID, 1,1,1); :confused: Thanks, Kevin
-
MFC worker thread and message QueuesTim, I’ve been writing server apps w/o a GUI so bear with me on my next question. Why would the GUI hang if a message queue has been created on an independent worker thread? I’m beginning to believe that a queue has not been created because the call to PeekMessage returns FALSE. -Kevin
-
MFC worker thread and message QueuesHi, When I’m not using MFC and starting worker threads with _beginthreadex I can give them message queues by calling: PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE); and then later on in the thread use GetMessage. I can do this without a window which is pretty cool. I tried putting PeekMessage into the ThreadFunc of a CWinThread derived class but it fails and, of course, the later call to GetMessage causes the program to hang. Before I start pounding my head against the wall I figured I would ask here to see if anybody would know why this would fail and if it is possible to workaround (without creating a window and using a UI thread). Thanks, -Kevin
-
App existence...going twiceNot sure if this will help as it is really old but search MSDN Lib for Q72918 in the title.
-
Multithreading in VBIs this true? Could you send me a pointer to MS's marketing hype on Multithreading in VB? Thanks, Kevin
-
EmulatorDon't try to use VB; unless you are looking for a headache. Use C++ instead.