[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: "Framework Studios: Hugo" <hugo@...>
- Date: Wed, 8 Jun 2005 19:12:10 +0200
Yes, that was it, thanks a lot!
-----Original Message-----
From: lua-bounces@bazar2.conectiva.com.br
[mailto:lua-bounces@bazar2.conectiva.com.br]On Behalf Of Romulo Bahiense
Sent: woensdag 8 juni 2005 17:46
To: Lua list
Subject: Re: Calling a function in a table from C++ without loosing
'self'
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