Jni callback works for java types, but not c types?

Sorry but I'm not able to comment in your question yet, so this is more a comment rather than an answer. Anyway, I've recently done something like that.

Sorry but I'm not able to comment in your question yet, so this is more a comment rather than an answer. Anyway, I've recently done something like that. My callback works and is implemented as: void jni_call_received_hook(char* username){ JNIEnv* m_env; (*m_vm)->AttachCurrentThread(m_vm, (void**) &m_env, NULL ); jclass cls = (*m_env)->FindClass( m_env, "gui/StateMachine" ); jmethodID mid = (*m_env)->GetStaticMethodID(m_env, cls, "callReceivedEvent", "(Ljava/lang/String;)V"); if (mid == 0){ log(E, "Unable to find method for callback"); return; } (*m_env)->CallStaticVoidMethod(m_env, cls, mid, (*m_env)->NewStringUTF(m_env, username)); } The variable m_vm is an instance of the JVM I've kept upon calling a method that registered this callback, like this: JNIEXPORT void JNICALL Java_gui_StateMachine_setCallReceivedCallback(JNIEnv *e, jobject o){ (*e)->GetJavaVM(e, &m_vm ); set_call_received_hook(jni_call_received_hook); } Maybe your missing something.

Let me know if this isn't clear enough. Hope it helps.

More details added on C struct and call chain. – mab Jun 21 at 6:54.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions