Integration with C

Geert Bevin
Fri Apr 18 18:02:00 GMT 2003

>   obj->method = (RawData) fnptr;

So you access the class member directly without providing it through a 
setter? I was wondering how to write a method in the Callback class that 
accepts a function pointer argument and stores it in the member 
variable. This to follow encapsulation rules. However, if that's not 
possible, what you propose could be sufficient.

> Geert> Since the interface needs to be declared in java as being
> Geert> native, there's no way to write a method that takes a function
> Geert> pointer argument, is there?
> You have to do some of the work in C++.  There's no way around that.
> I think I'm not understanding your question though.

See above.

> You can't derive a C++ class from a Java class.  You have to at least
> write the class declaration in Java.  That's a limitation of our
> implementation -- the C++ compiler doesn't know how to create a Java
> Class object.

Ok, thanks for clarifying that.

Geert Bevin                       Uwyn
"Use what you need"               Lambermontlaan 148               1030 Brussels
gbevin[remove] at uwyn dot com    Tel & Fax +32 2 245 41 06

PGP Fingerprint : 4E21 6399 CD9E A384 6619  719A C8F4 D40D 309F D6A9
Public PGP key  : available at servers,

More information about the Java mailing list