how do I get (in c) a method return value from the java side?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Nurit_Vered
Posted On:   Monday, December 2, 2002 08:12 AM

I have a class in the Java side, that I pass as object to the c side. in the Java class I have the following method: public String getPgmId() { return pgmId; } where pgmId is a private string. I nees to get the value of pgmId, hopefully by using the getPgmId method. what I have until now is: JNIEXPORT jint JNICALL Java_JavaAPI_StartProgram (JNIEnv *env, jobject obj, jobject obj2) { jmethodID methID; jstring jstr; const char *str; /* Get a reference to obj2 class */ jclass cls = (*env)->GetObje   More>>



I have a class in the Java side, that I pass as object to the c side.

in the Java class I have the following method:


			
public String getPgmId()

{

return pgmId;

}




where pgmId is a private string.


I nees to get the value of pgmId, hopefully by using the getPgmId method.

what I have until now is:


			
JNIEXPORT jint JNICALL Java_JavaAPI_StartProgram (JNIEnv *env, jobject obj, jobject obj2)

{

jmethodID methID;

jstring jstr;

const char *str;



/* Get a reference to obj2 class */

jclass cls = (*env)->GetObjectClass (env, obj2);

if (cls == NULL){

return;

}

methID = (*env)->GetMethodID (env, cls, "getPgmId", "(Ljava/lang/String;");


}//StartProgram




my question is how from this point, can I get the return value of the method getPgmId().


tnx

   <<Less
About | Sitemap | Contact