Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Use and understanding of message-map along with message
1. Use and Understanding Of
MESSAGE_MAP along with Message
Handlers
Presented By :
Sheth Shraddha(50)
Tamhane Vaidehi(54)
2. Use of MESSAGE_MAP
Windows Operating Systems – A Message
Driven System
Example : Mouse click, Printer signal
MESSAGE_MAP supports Message Driven
Programming in MFC.
Class Member Functions are used.
3. Role Of Class Member Functions
To execute commands
Messages are directed to class member
functions by the use of macros in MFC.
Convenience
5. Declaration
DECLARE_MESSAGE_MAP
– Declared in the class which allows to respond to messages.
– A class is eligible to execute a message map if it is derived
from CCmdTarget or a class which is derived from
CCmdTarget.
– A class can have only one message map.
– It should be the last member declared within a class.
– If not then next member should be preceded by an access
specifier.
8. Message Handlers
To respond to a message one must add a
message handler.
Members of CWnd class.
Can be overridden.
9. Naming Pattern Of Message Handlers
Start with “On”.
Succeeded by message name.
Should be in camel case.
Ex:
– Macro: WM_SIZE
– Handler: OnSize()