What is the use of message map? Advantages of a message map. What is the use of AFX_MANAGE_STATE?What is the use of message map? Advantages of a message map.
Any system is a message driven system. Every event has to be noted down and stored somewhere like a mouse click or a printer signal sends a message to the running application which in turn handles the message. The Microsoft Foundation Class (MFC) Library supports a message driven programming mode in which the central component is the Message Map which is used to map the message to the right process or device and allows the user to perform without any interference. It is also a very flexible and well integrated with tools such as MFC AppWizard and ClassWizard. As message maps are created from a set of macros then it allows the flexibility and functionality to be maintained and allow user to work efficiently. It has advantages of flexibility, you can store command messages, control notifications and register the messages which are going to be used later on.
What is the use of AFX_MANAGE_STATE?
AFX_MANAGE_STATE structure contains global data for the module, that is, the portion of the module state that is pushed or popped and also it is used to protect the exported function in DLL. Its syntax is like this AFX_MANAGE_STATE(AFX_MODULE_STATE* pModuleState ) where pModuleState is the pointer to the AFX_MANAGE_STATE structure. It is enable for static MFC libraries as well as MFC DLLs.
|