Re: Calling a function in a table from C++ without loosing 'self'
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Calling a function in a table from C++ without loosing 'self'
- From: Romulo Bahiense <romulo@...>
- Date: 2005年6月08日 12:45:42 -0300
Hi,
Try:
lua_pushstring(VM, m_TableName);
lua_gettable(VM, LUA_GLOBALSINDEX);
lua_pushstring(VM, "init");
lua_gettable(VM, -2);
// -2 is the index where the table is at this moment
lua_pushvalue(VM, -2);
lua_call(VM, 1, 0);
Hope this helps .
--rb