I have a C++ program which invokes an instance of the JVM. I would like that instance of the JVM to make a call to a native method in the C++ program that performed the invocation. Is there some way to get this to work without having to put the native method into a separate DLL?

Davanum Srinivas

Yes, you can register your native method using RegisterNatives:

 
const JNINativeMethod methods[] = { 
    {
        "test",
        "()V",
        &Java_GUITest_test
    }
};
env->RegisterNatives(env->FindClass("GUITest"), methods, 1); 
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


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

 

 

About | Sitemap | Contact