[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [LuaJIT FFI] [Windows] "bad callback" error in MsgWaitForMultipleObjects() proof-of-concept
- From: Duncan Cross <duncan.cross@...>
- Date: Fri, 23 Dec 2011 22:36:17 +0000
On Fri, Dec 23, 2011 at 10:19 PM, Mike Pall <firstname.lastname@example.org> wrote:
> Duncan Cross wrote:
>> Are you certain it's MsgWaitForMultipleObjects() calling that WNDPROC
>> callback itself though? My reading of the documentation for that
>> function  is that it only waits until there is an event to process,
>> it doesn't do anything about it - hence the usual calls to
>> TranslateMessage/DispatchMessageA afterwards in the loop. I tried
>> printing debug.traceback() in that callback - I see instances of
>> CreateWindowExA(), ShowWindow(), UpdateWindow(), PeekMessageA() and
>> DispatchMessageA() on the stack, but not MsgWaitForMultipleObjects().
> Ah, yes, it's DispatchMessageA(). I haven't checked the Windows
> docs for details.
>> (I realise this may not affect the explanation/solution much, but in
>> case it is significant I thought I better query this.)
> Well, it was clear it's one of the functions in the message loop.
> Doesn't really matter which one, though.
Great, all is clear now - thanks again.