Click here to Skip to main content
15,912,400 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: What is the datatype for "this" pointer in C++ Pin
CPallini23-Feb-10 21:05
mveCPallini23-Feb-10 21:05 
AnswerRe: What is the datatype for "this" pointer in C++ Pin
Emilio Garavaglia23-Feb-10 21:14
Emilio Garavaglia23-Feb-10 21:14 
AnswerRe: What is the datatype for "this" pointer in C++ Pin
Avi Berger23-Feb-10 21:31
Avi Berger23-Feb-10 21:31 
QuestionRe: What is the datatype for "this" pointer in C++ Pin
Avi Berger24-Feb-10 5:03
Avi Berger24-Feb-10 5:03 
AnswerRe: What is the datatype for "this" pointer in C++ Pin
KingsGambit23-Feb-10 22:43
KingsGambit23-Feb-10 22:43 
Questionasynchronouse thread function Pin
hrishi32123-Feb-10 18:14
hrishi32123-Feb-10 18:14 
AnswerRe: asynchronouse thread function Pin
CPallini23-Feb-10 20:30
mveCPallini23-Feb-10 20:30 
AnswerRe: asynchronouse thread function Pin
Rajesh R Subramanian23-Feb-10 20:40
professionalRajesh R Subramanian23-Feb-10 20:40 
hrishi321 wrote:
wheneerv a message comes i want to put in a queue..and the reciever function returns the control...now i want to have a thread, which will keep looking onto the queue...if empty, do nothing....if not empty then process the message....


That's what the UI thread does (if you're using MFC).


hrishi321 wrote:
main reason to do this is...instead of having the while loop in the thread function, which will eat CPU cycle, i want some mechanism to do task only when needed)...


WaitForSingleObject[^] could help you do this.

A queued event thread is fairly easy to implement if you're not using MFC as well. All you need is a thread, a message queue and a couple of events that signals if there's more messages to be processed and if the thread should stop execution immediately (app shut down) and a WaitForSingleObject (or multiple objects, depending on how you do it) call that would be used for waiting on the said events.

What have you thought of to solve this?

“Follow your bliss.” – Joseph Campbell

QuestionNeed to Implement some functions using Linked List in C++ Pin
Shah Ravi23-Feb-10 17:49
Shah Ravi23-Feb-10 17:49 
AnswerRe: Need to Implement some functions using Linked List in C++ Pin
«_Superman_»23-Feb-10 17:59
professional«_Superman_»23-Feb-10 17:59 
GeneralRe: Need to Implement some functions using Linked List in C++ Pin
Shah Ravi23-Feb-10 18:03
Shah Ravi23-Feb-10 18:03 
AnswerRe: Need to Implement some functions using Linked List in C++ Pin
Avi Berger23-Feb-10 19:06
Avi Berger23-Feb-10 19:06 
QuestionPROBLEM WITH MATRIX OPENGL Pin
tuan111123-Feb-10 15:37
tuan111123-Feb-10 15:37 
AnswerRe: PROBLEM WITH MATRIX OPENGL Pin
Saurabh.Garg23-Feb-10 17:19
Saurabh.Garg23-Feb-10 17:19 
AnswerRe: PROBLEM WITH MATRIX OPENGL Pin
Tim Craig23-Feb-10 18:29
Tim Craig23-Feb-10 18:29 
GeneralRe: PROBLEM WITH MATRIX OPENGL Pin
LunaticFringe23-Feb-10 18:55
LunaticFringe23-Feb-10 18:55 
GeneralRe: PROBLEM WITH MATRIX OPENGL Pin
Tim Craig23-Feb-10 22:11
Tim Craig23-Feb-10 22:11 
GeneralRe: PROBLEM WITH MATRIX OPENGL Pin
LunaticFringe24-Feb-10 7:30
LunaticFringe24-Feb-10 7:30 
AnswerRe: PROBLEM WITH MATRIX OPENGL Pin
Cedric Moonen23-Feb-10 20:40
Cedric Moonen23-Feb-10 20:40 
Questionmultiple run Pin
zakria8123-Feb-10 13:46
zakria8123-Feb-10 13:46 
AnswerRe: multiple run Pin
Avi Berger23-Feb-10 14:16
Avi Berger23-Feb-10 14:16 
GeneralRe: multiple run Pin
Richard Andrew x6423-Feb-10 14:47
professionalRichard Andrew x6423-Feb-10 14:47 
QuestionHow to disable auto sorting for CComboBox Pin
TechAvtar23-Feb-10 4:08
TechAvtar23-Feb-10 4:08 
AnswerRe: How to disable auto sorting for CComboBox Pin
TechAvtar23-Feb-10 4:11
TechAvtar23-Feb-10 4:11 
AnswerRe: How to disable auto sorting for CComboBox Pin
David Crow23-Feb-10 4:11
David Crow23-Feb-10 4:11 

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.