A SERVICE OF

logo

const int vnPenChange = vnCustomBase + 1;
Next use the NOTIFY_SIG macro to specify the signature of the event-
handling function. The NOTIFY_SIG macro takes two parameters, the first
being the event name and the second being the exact parameter type to be
passed to the function. The size of this parameter can be no larger than type
long; if the object being passed is larger than a long, you must pass it by
pointer For example, suppose for the vnP nChange event, you want to pass. e
a TP n object to the event-handling function. Because a TP n object is quitee e
a bit larger than a
long, you must pass the object by pointer The macro.
would look something like this:
NOTIFY_SIG(vnPenChange, TPen *)
Now you need to define the response table macro for your event. By
convention, the macro name uses the event name, in all uppercase letters,
preceded by EV_VN_. Use the #define macro to define the macro name.
Use the VN_DEFINE macro to define the macro itself. This macro takes
three parameters:
Event name
Event-handling function name (by convention, the same as the event
name preceded by Vn instead of the vn used for the event name)
Size of the parameter for the event-handling function; this can have four
different values:
void
int (size of an int parameter depends on the platform)
long (32-bit integer or far pointer)
pointer (size of a pointer parameter depends on the memory model)
Y u should specify the value that most closely corresponds to theo
event-handling function’ parameter type.s
The definition of the response table macro for the vnP nChange event woulde
look something like this:
#define EV_VN_PENCHANGE \
VN_DEFINE(vnPenChange, VnPenChange, pointer)
Note that the third parameter of the VN_DEFINE macro in this case is
pointer This indicates the size of the value passed to the event-handling.
function.
220
OWL P ogrammer’ Guider s