Connecting User-Interface Objects with Code

The MFC code that AppWizard generates may be sufficient for a small number of your application’s user-interface objects, such as the splash screen, but for the most part you’ll have application-specific routines that you want called when an interface object receives input from the user. To do that, you need to make a connection between the interface object, the event, and the code you want called.

The visual tools provided by the development environment simplify the task of connecting user-interface objects to your application-specific code. If you’ve used Visual C++ before, you’re probably familiar with the ways that ClassWizard automates such tasks as generating message-handler functions and message maps. Visual C++ implements two shortcuts to the ClassWizard dialog box: ClassView and WizardBar. In addition to providing a seamless link between your project classes and files, these tools make navigating through your source code as easy as pointing and clicking.

The tutorials demonstrate how these features simplify and speed the process of specifying how your user-interface objects respond to messages.

Suggested Reading