From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Tromey To: osk@hem.passagen.se Cc: java-discuss@sourceware.cygnus.com Subject: Re: CNI and interface methods Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-id: <200001252326.PAA03187@ferrule.cygnus.com> References: <20000125234733.A865@strix.eductussyd.se> X-SW-Source: 2000-q1/msg00142.html >>>>> "Oskar" == Oskar Liljeblad writes: Oskar> I read in the CNI documentation that it is not possible to call Oskar> methods using interface references. Do I have an old egcs/gcj Oskar> (2.95.2)? If not, any ideas when this will this be possible? This hasn't changed -- there is no way to directly make a call from C++ via an interface reference. As far as I know, nobody is working on this, so I don't know when it will be possible. Oskar> Are there any tricks to use meanwhile? I'm experimenting with Oskar> Gtk bindings using CNI, and using interfaces for signal Oskar> listeners is (usually) necessary. Yeah, I like the signal/interface approach too. Are you generating the bindings automatically from gtk.def? Anyway, you can use _Jv_LookupInterfaceMethod to look up the method via an interface, and then call it directly (you get back a raw pointer which you can treat as a function pointer; be sure to pass the object reference as the first argument). If you do this, though, be warned that this interface isn't really exported, and we might change it randomly. Tom