keyword because event response tables don’t require event response
functions to be virtual.
Here are some DDVT function declarations and their event response table
equivalents:
ObjectWindows 1.0: ObjectWindows 2.0:
virtual void CMSendText(TMessage &Msg) = void CmSendText();
[CM_FIRST + CM_SENDTEXT];
virtual void CMEmpInput(TMessage &Msg) = void CmEmpInput();
[CM_FIRST + CM_EMPINPUT];
virtual void HandleListBoxMsg(TMessage &Msg) = void HandleListBoxMsg(UINT);
[ID_FIRST + ID_LISTBOX];
virtual void WMInitMenu(RTMessage) = void EvInitMenu(WPARAM);
[WM_FIRST + WM_INITMENU];
virtual void BNClicked(RTMessage Msg) = void BNClicked();
[NF_FIRST + BN_CLICKED];
Each predefined Windows message has a specific message-handling
function associated with it. In addition, each function has a specific
signature that you must use when writing your own code for handling
these messages. The Windows messages and their corresponding function
names and signatures are listed in Chapter 2 of the ObjectWindows Reference
Guide.
If you use custom Windows messages, the function name is up to you. Y uo
specify the function name using one of the response table macros described
in the table on page 364. The function signature depends on which macro
you use. See the ObjectWindows Reference Guide for more information.
Naming conventions
Y u should name ObjectWindows 2.0 event-handling functions byo
prefixing the name of the function with two letters taken from the message
type (such WM, EV, CM, and so on). The first letter should be uppercase
and the second letter should be lowercase; don’t use two uppercase letters.
For example, CMCommand becomes CmCommand. The predefined
ObjectWindows message-handling functions are all named according to
this style.
OWLCVT converts ObjectWindows-1.0 style function names to the
ObjectWindows 2.0 style. If you make a call to the base class version of a
function, however OWLCVT does not convert that call. Y u need to, o
convert these calls manually For example, suppose your ObjectWindows.
1.0 application has a class called TMyWindow that has a function WMSize
that calls the TWindowsObject::WMSize function. OWLCVT converts the
TMyWindow::WMSize function name to TMyWindow::EvSize and the base
class name from TWindowsObject to TWindow, but it doesn’t convert the call
Appendix A, Converting ObjectWindows 1.0 code to ObjectWindows 2.0
363