how to write a jobject as return value
843829Oct 4 2001 — edited Jul 31 2002Problem: I need to set (write) about 5-10 values in my c function to return to the calling java method. The values are all primitive types and jstring. The arguments for the JNI function are all passed by value, so they are only input.
To my knowledge I can only use the return value for output.
Is it possible to define a jobject containing all member variables I need, set these variables in the c function and return the jobject to java ? Or even use a jobject as an argument (as that's the only type which is passed by reference) and set it in the C function ?
How can I do that - in the java portion and in the c portion ? I could not find this in the Java docs.
Sample code is appreciated.
Thanks, Bernhard