Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Enterprise, C++, Java
Expertise: Advanced
Sep 12, 2002

Define JNI Functions and Convert Java Parameters to C++ Parameters in VC++


Include the following definition:
 
#include <jni.h>

The function definition goes like:
 
JNIEXPORT jboolean JNICALL MethodName(
     JNIEnv *env,/*env variable: must*/
     jstring functionId,/*String variable*/
     jobject objectId/*Object variable*/
){
   const char *str = env->GetStringUTFChars(
                             functionId, 0);
   CString		functionIdStr(str);
   env->ReleaseStringUTFChars(functionId, str);

   jclass DetailClass = env->GetObjectClass(
                            objectId);
   /*DetailClass: The type of object passed as
    input*/

}
Amit Vij
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date