Thursday, March 8, 2007

Message Map Architecture in MFC

Message Map Architecture in MFC

Windows handles a lot of messages like click, double click, key down, key up etc.,

For eg.:- ON_WM_LBUTTONUP( ) is the handle that windows receives when Left Mouse button is pressed.

Once the program receives this handle it does not know what to do with it.

For this we use message maps.

MFC maintains a table where every windows message is mapped to a function.

An example is shown below.

ON_WM_LBUTTONUP( )

afx_msg void OnLButtonUp( UINT, CPoint );

MFC has a default function to execute when the user passes a handle to the window.

We can also override that Function.

So In short we can say Message Map is noting but the process of mapping a message handle to the corresponding function through a message map table.

No comments:

Post a Comment