what is message loop how mfc does it internally?
Answer Posted / sonali dongare
In Window programming Message is the main communication.The
messaes are stored in message queue.
the way you retrieve messages from the Message Queue is by
creating a Message Loop. A Message Loop is a loop that
checks for messages in the Message Queue. once a message is
received, the Message Loop dispatches the message by
calling a Message Handler, a function designed to help the
Message Loop at processing the message.
Message loop ends when WM_QUIT messae is retrived.In Mfc
WinMain is the entry point.since mfc uses event driven
programming model The Incoming messages enter in the
message queue window procedure process that messages and
send to window ,winmain create that window and enter into
message loop ,retrive messages and dispatches them to
window procedure.Messages wait in message queue untill they
are retrived.In order to retrive and dispatch the message
winmain execute simple while loop that call
GetMessage,TranslateMessage and DispathMessage API
Functions .GetMessage retrive message from message
queue ,TranslateMessage convert keyboard message to WM_CHAR
message and DispatchMessage dispatch messages to Window
procedure. Message loop end when it retrived WM_QUIT
message.
Is This Answer Correct ? | 40 Yes | 3 No |
Post New Answer View All Answers
What does mfc stand for?
How to handle dynamic menus in mfc? What happens when client calls cocreateinstance?
What is mfc class hierarchy?
2.create for 10 batch: Employee_Number Employee_name Employee_Dateofjoining Employee_address Employee_salary 1.select the employee name who deriving more than 10 thousand salary and joined before august 08. use structure and pointers
What is the difference between Struts and JSF? Pls list some most suitable differences.
List out the basic features of MFC.
what message is sent to an application when the user presses the primary button?
plzz tell me what we can do and dont in tally ERP & sap business one?
How do I create a dialog box in mfc?
what is the meaning of constant FILE EXCEEDS LENGTH LIMIT while loading from ps file to vsam in the jcl?
I want recent paper pattern for HP company?
how to repaint when working with horizontal scroll bar
what is functioning of DIalodDataXchange ..?
Do you have an idea about MFC?