lua-users home
lua-l archive

Re: Calling a function in a table from C++ without loosing 'self'

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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

AltStyle によって変換されたページ (->オリジナル) /