แก้ไข

แชร์ผ่าน


Mapping Messages to Functions

The Class Wizard enables you to bind message handlers (member functions of MFC user-interface classes) to the messages generated by your application's resources. They use MFC message maps to create the binding.

When you use Class View to create a new class derived from one of the framework classes, it automatically places a complete and functional class in the header (.h) and implementation (.cpp) files that you specify.

Note

To add a new class that does not handle messages, create the class directly in the text editor.

To define or remove a message handler using the Class Wizard

  1. In Class View, right-click the class.

  2. In the context menu, choose Class Wizard.

See also

MFC Message Handler
Adding Functionality with Code Wizards
Adding a Class
Adding a Member Function
Adding a Member Variable
Overriding a Virtual Function
Navigating the Class Structure