lua-users home
lua-l archive

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


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