lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I’m using Lua50 (LuaBinaries distribution) and LuaCOM.  I am not a COM expert L

 

I would like to know how to handle events that are being raised asynchronously. I think I need a message loop of some sort, but I’m not clear (after reading the documentation) on how to do this.

 

I have a COM component with a method that begins execution of a command on a remote device (the details aren’t important, I think) and then returns

 

While the command is executing and producing output, events are raised. But because my Lua script is continuing to execute without processing messages in some message loop, the script never receives events.

 

The example from the LuaCOM documentation using the AfterUpdate event of MSCAL.Calendar works fine – but that event is raised during the call from Lua of calendar.NextMonth, so doesn’t have the same asynchronous problem (the component I’m using has similar events, and they’re working fine too).

 

I have a _vbscript_ that does the equivalent to the Lua script and that’s working fine too (presumably because the Windows Scripting Host is doing something with message loops)

 

I’m missing something, probably something obvious.

 

Any pointers?

 

P.