John Labenski wrote:
> On Dec 23, 2007 9:21 AM, klaas.holwerda <[EMAIL PROTECTED]> wrote:
>   
> I had actually changed code to make this possible, before you could
> only have a pointer to C++ be one type, say a wxWindow, but if a
> function returns it as a wxEvtHandler it'd swap all the references to
> the object to a wxEvtHandler from being a wxWindow.
>
>   
>> What do you think?
>>     
>
> I tried adding an extra pointer for wxRED, which I know is not exactly
> the same since it sounds like you're casting the same object to two
> types, but at least this works.
>   
No I am not casting, the base class and the derived class have and are 
only one instance in the program.
So they are initialized to the "this" pointer of the class instance, 
that is why they have the same value.
They are used inside the lau script to get to the commandhandler/wrapper.
But of course the base class pointer is of the base class type, so only 
use-able for all the commands in that baseclass.
While the derived class commands can be called via the derived class 
pointer.
So two different pointers to exactly the same address are pushed into lua.
>
> Could you update to the newest CVS, regenerate your bindings and try again.
>
>   
I already used the latest, but will try again soon.
> I assume it will still fail and I'm guessing in this function. Try
> putting some statements like this into it for debugging.
>
> bool LUACALL wxluaT_pushuserdatatype(lua_State* L, const void
> *obj_ptr, int wxl_type, bool track, bool allow_NULL)
> {
> ...
>     wxPrintf(wxT("pushuserdatatype1 %p %p pushing %p type %d\n"),
> a2dLuaWP, a2dMaskProc, obj_ptr, wxl_type);
>         if (wxluaO_istrackedweakobject(L, (void*)obj_ptr, wxl_type, true))
>             return true;
>     wxPrintf(wxT("pushuserdatatype2 %p %p pushing %p type %d\n"),
> a2dLuaWP, a2dMaskProc, obj_ptr, wxl_type);
>
>
> Then if it fails the second time it was pushed I'd guess it was inside
> of wxluaO_istrackedweakobject and see where it fails there.
>
> Thanks for looking into this, I'd really like this sort of stuff working,
>   
Will try soon, bit to busy eating these days :-(
Glad to do something back, still working on the problem with the  static 
const in the other thread, i am affraid another issue to come ;-)

Thanks,

Klaas


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to