请输入您要查询的百科知识:

 

词条 Message Maps
释义

  1. References

{{refimprove|date=December 2016}}

Message Maps is the Microsoft Foundation Class Library message map facility.

Microsoft Windows implements polymorphism in window classes using its messaging facility. Due to the large number of messages involved, providing a separate virtual function for each Windows message results in a prohibitively large vtable.

MFC provides an alternative to the switch statement used in traditional Windows programs to handle messages sent to a window. A mapping from messages to member-functions may be defined so that when a message is to be handled by a window, the appropriate member function is called automatically. This message-map facility is designed to be similar to virtual functions but has additional benefits not possible with C++ virtual functions.

Message Maps maps the user action into the appropriate MFC class functions to handle it. The MFC Class which can handle message should be member of CCmdTarget, (i.e.) it should be hierarchically derived from CCmdTarget.

The advantage of Message Map is the same action can be mapped to more than one MFC class function.

It is similar to handling the messages in SDK application using WndProc callback functions, but in MFC with the help OOPS concepts

References

  • TN006: Message Maps

1 : Microsoft application programming interfaces

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/11/11 7:55:34