There is a good chance that I am doing something wrong, but when trying to implement some event callbacks for a Lecroy Voyager M3i USB analyzer I am finding that my call to StartMessageLoop() from a lua script will block. I took a look at the luacom_StartMessageLoop code in luacom.cpp and see that it is calling GetMessage - a blocking call. I'm not sure what the solution should be...perhaps using PeekMessage (with the PM_REMOVE parameter to remove the message after processing) instead of GetMessage? Although then the loop would only run until there are no more messages to process. For now I created a new method luacom_NextMessage (shown below) and I call it everytime I want to querry the queue. That seems to be working. Am I doing something wrong? Is this a bug? Is there a better way to ensure events get handled?
There is a good chance that I am doing something wrong, but when trying to implement some event callbacks for a Lecroy Voyager M3i USB analyzer I am finding that my call to StartMessageLoop() from a lua script will block. I took a look at the luacom_StartMessageLoop code in luacom.cpp and see that it is calling GetMessage - a blocking call. I'm not sure what the solution should be...perhaps using PeekMessage (with the PM_REMOVE parameter to remove the message after processing) instead of GetMessage? Although then the loop would only run until there are no more messages to process. For now I created a new method luacom_NextMessage (shown below) and I call it everytime I want to querry the queue. That seems to be working. Am I doing something wrong? Is this a bug? Is there a better way to ensure events get handled?