Click here to Skip to main content
15,887,585 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: PostThreadMessage does not work sometimes Pin
Rajesh R Subramanian23-Sep-11 6:07
professionalRajesh R Subramanian23-Sep-11 6:07 
GeneralRe: PostThreadMessage does not work sometimes Pin
Albert Holguin23-Sep-11 6:11
professionalAlbert Holguin23-Sep-11 6:11 
GeneralRe: PostThreadMessage does not work sometimes Pin
Rajesh R Subramanian23-Sep-11 6:14
professionalRajesh R Subramanian23-Sep-11 6:14 
GeneralRe: PostThreadMessage does not work sometimes Pin
rahul.kulshreshtha23-Sep-11 21:37
rahul.kulshreshtha23-Sep-11 21:37 
GeneralRe: PostThreadMessage does not work sometimes Pin
Albert Holguin25-Sep-11 10:24
professionalAlbert Holguin25-Sep-11 10:24 
GeneralRe: PostThreadMessage does not work sometimes Pin
rahul.kulshreshtha26-Sep-11 7:13
rahul.kulshreshtha26-Sep-11 7:13 
GeneralRe: PostThreadMessage does not work sometimes Pin
Albert Holguin26-Sep-11 7:57
professionalAlbert Holguin26-Sep-11 7:57 
GeneralRe: PostThreadMessage does not work sometimes Pin
Rajesh R Subramanian25-Sep-11 22:31
professionalRajesh R Subramanian25-Sep-11 22:31 
I can't think of any other reason for why some messages should go missing, except for if the queue is full. You can try increasing the message queue size (Google for this - a registry key can be modified to achieve this). If performance is of so much importance, I'd think of dropping MFC and switching to something lower (like STL) because you're now having the added overhead of MFC.

I hope you're using multiple threads (if not, it's about time you did). I could even think of using a thread pool in a scenario like this. If nothing, you could accept all messages and put it into data structure (so that the message is popped off the queue immediately), and then process messages from that data structure.

I think some redesigning may be required, based on your application's requirements.

Another person is telling you to go ahead and post messages like crazy, but that sounds like bad advice to me because that clearly is not working (the very reason why you started this thread).
"Real men drive manual transmission" - Rajesh.

GeneralRe: PostThreadMessage does not work sometimes Pin
rahul.kulshreshtha26-Sep-11 7:29
rahul.kulshreshtha26-Sep-11 7:29 
GeneralRe: PostThreadMessage does not work sometimes Pin
Albert Holguin26-Sep-11 7:59
professionalAlbert Holguin26-Sep-11 7:59 
GeneralRe: PostThreadMessage does not work sometimes Pin
Rajesh R Subramanian23-Sep-11 6:08
professionalRajesh R Subramanian23-Sep-11 6:08 
GeneralRe: PostThreadMessage does not work sometimes Pin
Albert Holguin23-Sep-11 6:13
professionalAlbert Holguin23-Sep-11 6:13 
GeneralRe: PostThreadMessage does not work sometimes Pin
Rajesh R Subramanian23-Sep-11 6:15
professionalRajesh R Subramanian23-Sep-11 6:15 
GeneralRe: PostThreadMessage does not work sometimes Pin
MicroVirus23-Sep-11 5:55
MicroVirus23-Sep-11 5:55 
GeneralRe: PostThreadMessage does not work sometimes Pin
Albert Holguin23-Sep-11 6:05
professionalAlbert Holguin23-Sep-11 6:05 
AnswerRe: PostThreadMessage does not work sometimes Pin
Randor 23-Sep-11 15:04
professional Randor 23-Sep-11 15:04 
GeneralRe: PostThreadMessage does not work sometimes Pin
rahul.kulshreshtha23-Sep-11 21:38
rahul.kulshreshtha23-Sep-11 21:38 
QuestionHigh CPU usage Pin
john563222-Sep-11 23:32
john563222-Sep-11 23:32 
AnswerRe: High CPU usage Pin
Code-o-mat22-Sep-11 23:57
Code-o-mat22-Sep-11 23:57 
AnswerMessage Removed Pin
23-Sep-11 1:37
rahul.kulshreshtha23-Sep-11 1:37 
GeneralRe: High CPU usage Pin
Erudite_Eric23-Sep-11 2:18
Erudite_Eric23-Sep-11 2:18 
AnswerRe: High CPU usage Pin
Erudite_Eric23-Sep-11 2:19
Erudite_Eric23-Sep-11 2:19 
AnswerRe: High CPU usage Pin
Chuck O'Toole23-Sep-11 4:59
Chuck O'Toole23-Sep-11 4:59 
QuestionIs CMap's PLookup thread safe ?? Pin
rahul.kulshreshtha22-Sep-11 21:26
rahul.kulshreshtha22-Sep-11 21:26 
AnswerRe: Is CMap's PLookup thread safe ?? Pin
Niklas L23-Sep-11 0:35
Niklas L23-Sep-11 0:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.