lua-users home
lua-l archive

Interesting aspect of tolua (C++ inheritance)

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


Hi,
i tried to get to know something about the inheriting mechanism of 
tolua some days ago, but did not receive any answers.
So this time i tried to make the "Subject" sound more interesting, 
well hopefully ;-)
The question in question was:
When I inherit Lua-"Classes" with tolua from an - with tolua- C++ 
exported class, it does not work expectingly.
like, if i exported my class CFoo to lua and use bar = CFoo:new()
then bar is an valid CFoo Object.
but if i use 
classFoo2 = {}
tolua.class (classFoo2, CFoo)
Foo2:new()
local result = {}
tolua.instance(result,Foo2)
return result
then doing x = Foo2:new() does not create a new C++ object...
How come? Any ideas...
Cheers and thanks,
Dave

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