I know how to quit the message loop, that's not the issue. The problem is in determining when to quit the message loop.
As things stand now, I've got a Perl event routine that executes when the OLE object issues an event. The perl event routine monitors these events and determines that it is likely that the OLE object has completed it's work.
If I was certain that this was true, I could just quit the message loop and all would be well. Unfortunately, I can not be certain that the OLE object is indeed done until I wait for a bit while allowing the message loop to continue to run since there may be additional events. So what I was hoping would work was to set an alarm for a bit later. If the alarm fires, then there have been no more OLE events and I am indeed done, so I can stop the OLE message loop. If on the other hand there is another OLE event, the OLE event routine catches it since the OLE event loop is still running and I reset the alarm and wait for another potential completion condition to exist.
I could do this with perl's alarm BUT while the OLE message loop is running, alarm doesn't work! So what I need is an alarm like thing that will work while the OLE message loop is active.
Either that or some other workaround for this OLE message loop behavior. | [reply] |