• Advertisement
Sign in to follow this  

lua with CWinThread

This topic is 4917 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement