how does the UIThread and worker thread communicates and
handle events

Answers were Sorted based on User's Feedback



how does the UIThread and worker thread communicates and handle events..

Answer / vikram

UI thread and Worker thread can communicate with each other using SendMessage() or PostMessage().SendMessage() returns when the message is used by the Thread. PostMessage Returns immediately. These two method require Window handle of the UI Thread.

One can also use PostThreadMessage(thread id, message).here UI thread id is required.

Is This Answer Correct ?    0 Yes 0 No

how does the UIThread and worker thread communicates and handle events..

Answer / vishnu

Worker threads are used to process in back and can not
modify any user interface directly.
Ex: Used to calculate some complicated calculations.

UI threads can change user interface directly
Ex: Used to change UI display images in windows MFC
application

Is This Answer Correct ?    1 Yes 3 No

Post New Answer

More MFC Interview Questions

1)why we cant create more than one instance of the class Derived from CWinApp

5 Answers   Alstom,


What is serialization ?which function is responsible for serializing data ?

5 Answers  


What is stack size in win32 program?

1 Answers   HCL,


How to update all the views whenver document got updated ?

1 Answers  


Why not virtual functions to handle messages?

5 Answers  






I have 2 threads. One thread prints odd numbers and the second thread prints even numbers. Now, I have to execute the threads alternatively so that i can output 1,2,3,4,5,6,..... write code for this?

1 Answers  


What is Thread ?(VC++)What is the difference between Cmutex and Csemaphone?

5 Answers   Atos Origin,


Can you explaing the relashionship between document,frame and view ?

2 Answers  


How many types of combo box are their

2 Answers   Aaditya Info Solutions, E Logic,


How to convert the content of buffer into lower case character.

3 Answers   E Logic,


What is subclassing?

2 Answers  


Explain in sort What is CTargetObject?

2 Answers  


Categories