Hi everyone, I am thinking a solution but not yet implemented to test it. I use wxApp to hold the data. So in MyApp class I add two methods:
void SetGlobalObj(wxLuaState* ); void GetGlobalObj(wxLuaState* ); In SetGlobal I will get the lua table or light user data (it could be a table / or lightuserdata from a lua state.) Then set a member of MyAPP (which could be an r array or pointer) to hold the references. In GetGlobalObj I will push these pointer into a global lua table so in lua code (another lua state) I will get the references. After that I will dynamiccast to the wx class type and use it. So in second lua state call wxGetApp() and cast it to MyApp() then call GetGlobalObj(**) The purpose for now in my app is to use an already contructed wxSocket and pass it to the new thread that use different lua state. But if the above is correct then I can see some other usage as well. Any comment on it or I am just crazy :-) Cheers, S.KIEU Send instant messages to your online friends http://au.messenger.yahoo.com
--- Begin Message ---Hi everyone, In C++ code I create two separated wxLuaState and I want them to have the same global variables (which means from both luas script run by each state I can access one same global variables. Is it possible and if yes how? Thanks you very much. Kind regards, S.KIEU Send instant messages to your online friends http://au.messenger.yahoo.com
--- End Message ---
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ Wxlua-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wxlua-users
