[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Registering methods with lua_register
- From: "Michael T. Richter" <mtr@...>
- Date: Sat, 29 Jan 2000 14:36:12 -0500
C++ methods, unless they are static methods, all have an invisible first
parameter. You know this invisible first parameter as the "this" pointer.
Basically you won't be able to do what you want the way you want to do it.
----- Original Message -----
From: "Flavio Spolidoro Ferreira Gomes" <email@example.com>
To: "Multiple recipients of list" <firstname.lastname@example.org>
Sent: Friday, January 28, 2000 12:49 PM
Subject: Registering methods with lua_register
> I am trying to register a C++ object method to be called from the lua
> but I am getting the following warning:
> ev_lua_engine.cpp: In method `LuaEngine::LuaEngine(char *)':
> ev_lua_engine.cpp:95: warning: converting from `void (LuaEngine::*)()' to
> (*)(lua_State *)'
> Look at how I am doiing this:
> lua_register(LuaState, "ev_trap", this->EngineExec);
> This was the line 95.
> LuaState is a lua_State * variable which holds my enviromnet state (Iam
> using LuaNG);
> EngineExec is a method of my class LuaEngine.
> If I register a C pure function everything works fine.
> Does anyone know the correct way to register a C++ method?
> Thanks in advance.
> Flavio Spolidoro.