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,
 Cloud                            mailto:cloudwu@163.com
            http://blog.codingnow.com

[偷懒和没有耐性会促使优秀的程序员无法忍受重复做同样的事情]