Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


what is message loop how mfc does it internally?

Answers were Sorted based on User's Feedback



what is message loop how mfc does it internally?..

Answer / 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

what is message loop how mfc does it internally?..

Answer / mvs ravi kumar

Generally Windows programming is an event driven
programming. As and when something happens the some
message will be posted into message loop.

First of all, WinMain is the function which is being called
in windows application. This WinMain calls Initinstance of
that application and then enters the message loop.

Suppose take the case of SDI/MDI Application:
In SDI application messages are first sent it MainFrame
class, if there is no message handle in MainFrame then the
same message will be directed to CView. In the same way if
there is a handle for the message in View then the message
will be handled in the view other wise it will be directed
to CDocument. If there is message handle for the message
in Document then that handler function will be called
otherwise the message will be sent to CDocTemplate Class.
Then the message will be posed to another view if another
view exists otherwize the message will be sent to
DefWindowProc.

Is This Answer Correct ?    7 Yes 1 No

what is message loop how mfc does it internally?..

Answer / viresh chaudhari

The windows application enters the message loop within
Winmain to process various windows messages the OS posts to
a message queue.The message loop, "Loops" until its
receives a WM_QUIT message. It uses GetMessage and
PeekMessage to retrive messages and PostMessage to sent the
retrived messages to Windows procedure.

Is This Answer Correct ?    8 Yes 3 No

what is message loop how mfc does it internally?..

Answer / manjinder

Message loop exists internally in the WinMain() which is
the default function given by the MFC framework. In the
WinMain() there is one function called Run() which is
running this message loop. There are two types of window
messages .
1)Command routing: These commands come from menus,toolbars
etc.
2) Windows messages: These messages occured when some child
control of view or dialog box is used.

Is This Answer Correct ?    3 Yes 2 No

Post New Answer

More MFC Interview Questions

what is the meaning of constant FILE EXCEEDS LENGTH LIMIT while loading from ps file to vsam in the jcl?

0 Answers  


Differ GetMessage, PostMessage & PeakMessage?

4 Answers   Symphony,


What is model and modeless dialog box ? Give some examples?

2 Answers   Mphasis,


What is the difference between Synchronous sockets and asynchronous sockets?

2 Answers  


How can update edit control data of an executing application from other application?

3 Answers   HP,


What is thread & process?

15 Answers   Exaband,


What is the difference between OnInitialUpdate and OnUpdate?

5 Answers  


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

2 Answers  


how many types of classes are ther,what are that

7 Answers   L&T,


if both base and derived class have the constructors if i create an object for derive class which class constructor is executed first

10 Answers   Siemens, Symphony,


what is the size of a process

2 Answers   E Logic, IBM,


1)How to create ToolTip in MFC?

2 Answers  


Categories