lua with CWinThread

Started by
0 comments, last by cndv3996 19 years, 8 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