CNI and interface methods
Tom Tromey
tromey@cygnus.com
Sat Apr 1 00:00:00 GMT 2000
>>>>> "Oskar" == Oskar Liljeblad <osk@hem.passagen.se> 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
More information about the Java
mailing list