P
Philipp Kraus
Hello,
I hope this question is not OT.
I create a JNI call for this Java method
class myclass {
void native mymethod( Double[] x )
}
so the parameter x should be a call-by-reference, I would set x in the
native JNI function:
void mymethod( JNIEnv *jenv, jclass jcls, jobjectArray& jarg )
{
// do something
jobjectArray t = .....
jarg = t;
}
How can I set the jobjectArray& back, so the data is return in the parameter x?
IMHO I need jenv->NewGlobalRef, os this the correct use jarg =
(jobjectArray)jenv->NewGlobalRef( (jobject*) &t ) ?
Thanks
Phil
I hope this question is not OT.
I create a JNI call for this Java method
class myclass {
void native mymethod( Double[] x )
}
so the parameter x should be a call-by-reference, I would set x in the
native JNI function:
void mymethod( JNIEnv *jenv, jclass jcls, jobjectArray& jarg )
{
// do something
jobjectArray t = .....
jarg = t;
}
How can I set the jobjectArray& back, so the data is return in the parameter x?
IMHO I need jenv->NewGlobalRef, os this the correct use jarg =
(jobjectArray)jenv->NewGlobalRef( (jobject*) &t ) ?
Thanks
Phil