OWLNext 7.0
Borland's Object Windows Library for the modern age
|
ObjectWindows provides a large number of macros, called command message macros, that let you assign command messages to any function.
The only requirement is that the signature of the function you specify to handle a message must match the signature required by the macro for that message. The different types of command message macros are listed in the following table:
Macro and Prototype | Description |
macro: EV_COMMAND(CMD, UserName) | Calls the member function UserName when the command message CMD is received. |
prototype: void UserName() | |
macro: EV_COMMAND_AND_ID(CMD, UserName) | Calls the member function UserName when the command message CMD is received. Passes the command's ID (the WPARAM parameter) to the function. |
prototype: void UserName(WPARAM) | |
macro: EV_COMMAND_ENABLE(CMD, UserName) | Used to automatically enable and disable command controls such as menu items, tool bar buttons, and so on. |
prototype: void UserName(TCommandEnabler&) |
The following table shows message macros that let you pass the raw, unprocessed message on to the event-handling function. These message macros handle any kind of generic message and registered message.
Macro and Prototype | Description |
macro: EV_MESSAGE(MSG, UserName) | Calls the member function UserName when the user-defined message MSG is received. MSG is passed to UserName without modification. |
prototype: LRESULT UserName(WPARAM, LPARAM) | |
macro: EV_REGISTERED(MSG, UserName) | Calls the member function UserName when the registered message MSG is received. MSG is passed to UserName without modification. |
prototype: LRESULT UserName(WPARAM, LPARAM) |
It is very important that you correctly match the function signature with the macro that you use in the response table definition. For example, suppose you have the following code: