Re: Wrong userdata pointer returned since update to luabind 0.9
Stefan Reusch <[email protected]>
| Newsgroups | gmane.comp.lang.lua.bind.user |
|---|---|
| Message-ID | <[email protected]> |
ahh, i forgot. the line with touserdata has worked with the old version, definitly. 2010/2/24 Stefan Reusch <[email protected]>: > Thanks for your help. Your line is not correct too, because the > baseclass is CLuaWndBaseClass, but know it works with > > pParent = static_cast<CLuaWnd<>*>(luabind::object_cast<CLuaWndBaseClass*>(ParentWindow)); > > 2010/2/24 Daniel Wallin <[email protected]>: >> On Wed, Feb 24, 2010 at 02:51:40PM +0100, Stefan Reusch wrote: >>> Here are the two functions... >> [...] >>> bool CLuaLabel::Create(luabind::object const& ParentWindow, >>> luabind::table<luabind::object> const& Rect) { >>> CRect r; >>> CLuaWnd<>* pParent = NULL; >>> >>> if(luabind::type(ParentWindow) == LUA_TUSERDATA) { >>> pParent = luabind::touserdata<CLuaWnd<>>(ParentWindow); >> >> This line doesn't extract the held C++ object. It should be something >> like: >> >> pParent = luabind::object_cast<CLuaWnd<>*>(ParentWindow); >> >> Assuming CLuaWnd is a registered base. >> >>> The code has worked before i switched to luabind 0.9, but perhaps you >>> has an idea what the problem is... >> >> Are you sure this worked before? I don't see how it could. >> >> -- >> Daniel Wallin >> BoostPro Computing >> http://www.boostpro.com >> >> ------------------------------------------------------------------------------ >> Download Intel® Parallel Studio Eval >> Try the new software tools for yourself. Speed compiling, find bugs >> proactively, and fine-tune applications for parallel performance. >> See why Intel Parallel Studio got high marks during beta. >> http://p.sf.net/sfu/intel-sw-dev >> _______________________________________________ >> luabind-user mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/luabind-user >> > ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev