Click here to Skip to main content
15,936,349 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionMFC Thread queue size Pin
ajmalsiddiqi12-Apr-10 23:42
ajmalsiddiqi12-Apr-10 23:42 
QuestionRe: MFC Thread queue size Pin
David Crow13-Apr-10 2:52
David Crow13-Apr-10 2:52 
AnswerRe: MFC Thread queue size Pin
ajmalsiddiqi13-Apr-10 7:14
ajmalsiddiqi13-Apr-10 7:14 
GeneralRe: MFC Thread queue size Pin
David Crow13-Apr-10 7:32
David Crow13-Apr-10 7:32 
AnswerRe: MFC Thread queue size Pin
Stephen Hewitt13-Apr-10 13:57
Stephen Hewitt13-Apr-10 13:57 
GeneralRe: MFC Thread queue size Pin
ajmalsiddiqi13-Apr-10 21:30
ajmalsiddiqi13-Apr-10 21:30 
GeneralRe: MFC Thread queue size Pin
Stephen Hewitt14-Apr-10 1:18
Stephen Hewitt14-Apr-10 1:18 
GeneralRe: MFC Thread queue size Pin
ajmalsiddiqi14-Apr-10 2:10
ajmalsiddiqi14-Apr-10 2:10 
There is no UI thread all are worker threads.This was not the exact code , the exact code is running well there is no issue in the application.I just write the scenrio of my requirment.

1.If there is message in the queue it will be processed and then will be removed.So there is need little correction is code:
PeekMessage(pmsg, NULL, 0, 0, PM_REMOVE); // -(2) is inside the switch, not out of the inner while loop.

while(PeekMessage(pmsg, NULL, 0, 0, PM_NOREMOVE)) // -(1)
		{
			switch(pmsg ->message)
			{
			case MSG_RE_START:
			// log here pending messages in queue
			//do some functionality
break;
			case MSG_RE_STOP:
			// log here pending messages in queue
			//do some functionality
break;
                         case MSG_RE_DATA:
                         // get number of pending messages
                          //Process data
break;

			}
PeekMessage(pmsg, NULL, 0, 0, PM_REMOVE); // -(2)
	}

2.The main thread is not constantly spinning in a busy loop, becasue it waits on some events when exits from the inner loop.I did not mention, So leave it

3. Leave this, assume that the application is running not closing.

I just want to know that How can i get the pending number of messages in queue , for example when i receive MSG_RE_DATA message,How many number of messages MSG_RE_DATA are pending.
ajmalsiddiqui

GeneralRe: MFC Thread queue size Pin
Stephen Hewitt14-Apr-10 2:48
Stephen Hewitt14-Apr-10 2:48 
GeneralRe: MFC Thread queue size Pin
ajmalsiddiqi14-Apr-10 3:35
ajmalsiddiqi14-Apr-10 3:35 
QuestionCustom dropdown for CComboBox [modified] Pin
SpaceMonkey197012-Apr-10 21:25
SpaceMonkey197012-Apr-10 21:25 
AnswerRe: Custom dropdown for CComboBox Pin
Iain Clarke, Warrior Programmer12-Apr-10 22:57
Iain Clarke, Warrior Programmer12-Apr-10 22:57 
GeneralRe: Custom dropdown for CComboBox Pin
SpaceMonkey197013-Apr-10 0:47
SpaceMonkey197013-Apr-10 0:47 
GeneralRe: Custom dropdown for CComboBox Pin
Iain Clarke, Warrior Programmer13-Apr-10 0:56
Iain Clarke, Warrior Programmer13-Apr-10 0:56 
AnswerRe: Custom dropdown for CComboBox Pin
Code-o-mat13-Apr-10 6:18
Code-o-mat13-Apr-10 6:18 
GeneralRe: Custom dropdown for CComboBox Pin
SpaceMonkey197013-Apr-10 8:49
SpaceMonkey197013-Apr-10 8:49 
GeneralRe: Custom dropdown for CComboBox Pin
Code-o-mat13-Apr-10 9:15
Code-o-mat13-Apr-10 9:15 
QuestionConverting an image into jpeg format Pin
Srivathsa_12-Apr-10 20:57
Srivathsa_12-Apr-10 20:57 
AnswerRe: Converting an image into jpeg format Pin
Vijjuuu.12-Apr-10 21:06
Vijjuuu.12-Apr-10 21:06 
GeneralRe: Converting an image into jpeg format Pin
Iain Clarke, Warrior Programmer12-Apr-10 23:20
Iain Clarke, Warrior Programmer12-Apr-10 23:20 
GeneralRe: Converting an image into jpeg format Pin
CPallini12-Apr-10 23:35
mveCPallini12-Apr-10 23:35 
GeneralRe: Converting an image into jpeg format Pin
Vijjuuu.12-Apr-10 23:40
Vijjuuu.12-Apr-10 23:40 
GeneralRe: Converting an image into jpeg format Pin
CPallini12-Apr-10 23:47
mveCPallini12-Apr-10 23:47 
AnswerRe: Converting an image into jpeg format Pin
Cedric Moonen12-Apr-10 21:12
Cedric Moonen12-Apr-10 21:12 
AnswerRe: Converting an image into jpeg format Pin
CPallini12-Apr-10 21:21
mveCPallini12-Apr-10 21:21 

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.