lua-users home
lua-l archive

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

Hello mark,

Thursday, December 21, 2006, 9:06:20 AM, you wrote:

mg> Option 2 is for when you need one lua_State per window.
mg> You can read MSDN on GetWindowLong/SetWindowLong (I won't explain them).
mg> But the following code will give you an idea:

But message process and create window may not in the same coroutine.
For example, if you are calling UpdateWindow in a lua coroutine.
UpdateWindow will call SendMessage(hWnd,WM_PAINT) , and this will call
my WinProc . At this time, it needs coroutine's lua_State *L , not the
lua_State at the time window created .

Best regards,