WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Dialog Editor version 6.X
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Event Handling Questions


Question:

What happens if an event is being serviced by a UDS/UDF and another event occurs before it finishes?

Answer:

What happens? That depends. WB will tell the control to freeze events when it is processing inside a dialog callback. This is necessary because callback routines are not re-entrant and one routine handles many COM and non-COM events. The control can decide to wait until WB is done handling an event to send the next event or it can cancel the next event. It is all up to the control. (One reason to use ObjectEventAdd with a dialog hosted CONTROL is to handle a specific event fired by an object method call inside the dialog callback when that event is not saved by the CONTROL. This works because the dialog function and ObjectEventAdd use different event sinks and freezing events on one sink does not freeze them on the other.)

ObjectEventAdd does not freeze events in the way the dialog function does because it deals with non-control objects that may not support the interface for freezing events. But it is still up to the object to decide what to do with an event, if another event is outstanding. You can get yourself into a lot of trouble using ObjectEvetAdd with a poorly designed COM object, if you use UDSs instead of UDFs and the UDS is not re-entrant. Among other things your script could find itself in a race condition.

Keep in mind that this is still in beta and we may change a few things before general release. Also, COM event handling is not for the faint hearted script writer. It requires a little more knowledge and understanding of basic concepts than most other WB scripting. But it does have the potential to be a powerful tool.


Article ID:   W16920
File Created: 2007:07:03:14:27:04
Last Updated: 2007:07:03:14:27:04