I'm new to JNI and have a Java program given, from which I want to call methods in C++. I have an ObjectA implemented in Java. I receive its classID like this in C++:
jclass cls = env->FindClass("myPackages/ObjectA");
Now I have the method funcA given in Java. funcA accepts an Object of the type ObjectA as an argument and returns an integer. The declaration in Java looks like this:
public int funcA( ObjectA obj);
Now I want to get the methodID of funcA in C++. The problem is, I don't know how to specify which parametertype the method gets. I know that I have to write L fully-qualified-class ; to pass Objects like a String, but how do I do this, when the objects are not from official javalibraries but objects I created? I tried this, but it obviously didn't work:
jmethodID jfuncA = env->GetMethodID(cls, "funcA", "(Lcls;)I");
All I got as a response is, that the Method was not found. So what do I have to write instead of (Lcls;)? Or is this impossible?
Any idea is useful!