I have a simple problem and cannot find the answer. I wrote a method in C ++ that should call a method in Java that takes an object. For example, my Java code has:
public class MyClass {
public class ReturnType {
...
}
public void methodToBeCalledFromC( ReturnType obj ) {
...
}
}
And my C ++ has:
const jclass classID = s_env->FindClass( className );
const jmethodID methodID = s_env->GetMethodID( classID, "methodToBeCalledFromC", "(LMyClass;)V" );
s_env->CallVoidMethod( call.handler(), jmid, userInfo );
I check the classID and methodID, and it call.handler()returns the jbject that I called NewGlobalRef(), so I think everything is fine.
Is it possible to transfer the task in this way?
source
share