Use and Understanding of MESSAGE - MAP Along With Message
Use and Understanding of MESSAGE - MAP Along With Message
Presented By :
Sheth Shraddha(50)
Tamhane Vaidehi(54)
Use of MESSAGE_MAP
To execute commands
Messages are directed to class member
functions by the use of macros in MFC.
Convenience
Components Of MESSAGE_MAP
Declaration
Beginning
Termination
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.
BEGINNING
BEGIN_MESSAGE_MAP
– Parameters
Class name which implements the message map.
Base class
– Succeeded by macros which represent
messages.
Termination
END_MESSAGE_MAP
– Messages macros are succeeded by
END_MESSAGE_MAP
Message Handlers