OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
Interpreting a control event

After a VBX control event has taken place and the event-handling function has been called, the function must deal with the VBXEVENT structure received as a parameter.

This structure looks like this:

The members are

MemberDescription
hCtlThe handle of the sending VBX control (not a window handle)
hWndThe handle of the control window
nIDThe ID of the VBX control
iEventThe event index
lpszEventThe event name
cParamsThe number of parameters for this event
lpParamsA pointer to an array containing pointers to the parameter values for this event

To understand the VBXEVENT structure, you need to understand how a VBX control event works. The first three members are straightforward: They let you identify the sending control. The next two members are also fairly simple: Each event that a VBX control can send has both an event index, represented by iEvent, and an event name, represented by lpszEvent.

The next two members, which store the parameters passed with the event, are more complex. cParams contains the total number of parameters available for this event. lpParams is an array of pointers to the event's parameters (like any other array, lpParam is indexed from 0 to cParams - 1).

These two members are more complicated than the previous members because there is no inherent indication of the type or meaning of each parameter. If the control is from a third-party VBX control library, you can look in the control reference guide to find this information. Otherwise, you need to get the information from the designer of the control (or to have designed the control yourself).

See Also