🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

lua with CWinThread

Started by
0 comments, last by cndv3996 19 years, 11 months ago
i'm using MFC.i created a thread with AfxBeginThread(),and wanted to call lua_dofile() in it,but failed...the program crashed... the thread function is like this: UINT ScriptThrd(LPVOID pView) { while(1) { if(((CplunderView*)pView)->theScript[0]!=0) { ((CplunderView*)pView)->theLua.DoFile("Script/start.lua"); //theLua.DoFile()is a wrapper of lua_dofile(); } AfxGetThread()->SuspendThread(); } return 0; } can i solve it?
only detective is forever,not spy...
Advertisement
oh,god sei dank,
i solved it,it's not the fault of lua...

i just can't get proper value using AfxGetMainWnd() in a thread...
only detective is forever,not spy...

This topic is closed to new replies.

Advertisement