In order to properly handle ActiveX and COM events, it is important to understand how the runtime behaves in certain situations.
Following are default runtime behaviors. If you want to change the behavior, you can add configuration variable(s) to your
runtime configuration file.
- The runtime ignores events from all controls while it is creating an ActiveX control or COM object. If you are using a control
that delivers significant information using events and you don't want to miss those events while you are creating a new control,
set the CONTROL_CREATION_EVENTS runtime configuration variable to "1" (on, true, yes).
- The runtime suspends ActiveX and COM events when the application is not processing an ACCEPT statement; in other words, it
suspends events in between ACCEPT statements. If your control does not support the suspend/resume behavior and you are using
it with the ACUCOBOL-GT Thin Client, this can be problematic. To prevent problems, set the TC_RESTRICTS_AX_EVENTS thin client
configuration variable to "1" to mimic the runtime behavior.
- The runtime allows events to trigger while it is processing other events. If this is not handled properly, the runtime could
execute the same code simultaneously in two threads on the same data. Set NESTED_AX_EVENTS to "0" (off, false, no) if you
do not want event procedures to be nested. Be aware that this option may cause you to lose certain events (typically events
triggered by modifications made in the event procedure).
For details on these configuration variables, please see Configuration Variables.