I'm trying to instantiate and use object of Lua classes from C++. 
Lua class is defined like this.

```
myclass = {}

function myclass:new(o)
   o=o or {}
   setmetatable(o,self)
   self.__index=self
   return o
end

function myclass:init()
   self.something = 0
end

function myclass:perform()
   self.something = self.something + 0.5
   return performsomething(self.something)
end

```

To instantiate object in C++, I do the following : 

```
lua_getglobal(L,"myclass");
lua_getfield(L, -1, "new");
lua_pcall(L,0,1,0);
lua_newtable(L);
lua_setglobal(L, "objname");

```

Then to initialize : 

```
lua_getglobal(L,"myclass");
lua_getfield(L, -1, "init");
lua_getglobal(L,"objname");
lua_pcall(L, 0, 0, 0);

```

And then to perform : 

```
lua_getglobal(L, "myclass");
lua_getfield(L, -1, "perform");
lua_getglobal(L, "objname");
lua_pcall(L, 0, 1, 0);
double res = lua_tonumber(-1);

```

For this example, I didn't include the `lua_pop()` methods I use when needed. 

It appears that, with prints, I could get the following informations. Lua object is successfully instantiated with new method. It is also successfully initialized in init method. But, when calling perform method, `self.something` member doesn't change, its value is stucked to 0, which seems to mean I'm not calling the object member method.  

I'm pretty sure there is something wrong with the way I manage Lua stack to access object member function. 

Did anyone already worked with a similar case and could help here ? 
Thanks
Bests