Begin and End Message Map Macros

In Origin C resource events are mapped to event handler functions with a message map. Message maps consist of a begin message map macro, then a series of event macros, and finally an end message map macro. The table below summarizes a pair of begin and end message map macros used when the Origin C dialog implementation is encapsulated within a user-defined class.

Macro

Description

EVENTS_BEGIN

Begin a message map encapsulated within a user-defined class (recommended). Must be paired with EVENTS_END.

EVENTS_END

End a message map encapsulated within a user-defined class (recommended). Must be paired with EVENTS_BEGIN.

It is recommended that you encapsulate the implementation of your dialog within a class structure (for information on why and how to do this see the topic Choosing the Programming Language to Control your Dialog in the section Creating A Microsoft Visual C++ Resource-only DLL). However, a second pair of begin and end message map macros used when the Origin C dialog implementation is not encapsulated within a class structure is also provided in the table below.

Macro Description
BEGIN_EVENT_MAP Begin a message map not encapsulated within a user-defined class. Must be paired with END_EVENT_MAP.
END_EVENT_MAP End a message map not encapsulated within a user-defined class. Must be paired with BEGIN_EVENT_MAP.

For detailed examples demonstrating how to begin and end a message map see any of the examples in the section Origin C Dialog Builder Examples. The remaining topics in this section discuss event macros for simple dialogs, tabbed dialogs, wizards, and several different types of controls.