dcsimg
How to implement OUT parameters in JNI
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   santhi_sirisha
Posted On:   Wednesday, March 19, 2003 03:24 AM

Hi, I am trying to develope a wrapper for a "c API". There are using Char * as a OUT parameter,in the sense it's initialized in the c function. I am tried with jstring..But that value is not reflecting in Java program... JNIEXPORT jint JNICALL Java_Wrapper_GetVersion(JNIEnv *env,jobject obj, jstring jversion) { unsigned long unStatusCode = 0; unsigned char *uszVersion=NULL; unsigned long unVersionLen = 0; unStatusCode = GetVersion(uszVersion,&unVersionLen); jversion=env->NewStringUTF((const char*)uszVersion); return (jint)1; } jversion value is not reflecting in Java program.. And one more thing can u tell how to impl   More>>

Hi,
I am trying to develope a wrapper for a "c API". There are using Char * as a OUT parameter,in the sense it's initialized in the c function. I am tried with jstring..But that value is not reflecting in Java program...


JNIEXPORT jint JNICALL Java_Wrapper_GetVersion(JNIEnv *env,jobject obj, jstring jversion)
{

unsigned long unStatusCode = 0;
unsigned char *uszVersion=NULL;
unsigned long unVersionLen = 0;
unStatusCode = GetVersion(uszVersion,&unVersionLen);
jversion=env->NewStringUTF((const char*)uszVersion);
return (jint)1;

}


jversion value is not reflecting in Java program..

And one more thing can u tell how to implement int as OUT parameter also.Thanks in Advance.    <<Less
About | Sitemap | Contact