Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Call Java function triggered by C++ thread  RSS feed

Joe Schaffer
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody!

Before I come to the problem, I have to give a small description to my program. My Environment is Windows 2000.

I hava a java program implementing a JNI interface for an MFC Dll (Visual6). This Bridge.dll starts a thread, through a JNI function call, running on a further thread.dll. The tread is running in the background and it works. If I call a function from java, I can also call a callback function by using the same JNIEnv and jobject.

My problem starts, if I want to call a function initiated by the thread.dll. While doing this I'm unable to access the proper JNIEnv and jovject pointer/objects. I tried to store them global, received during a previous function call, but the program will crash by using them.

How can I make a java function available to the bridge.dll in the same way I make them available for the java program?

Hope to hear any suggestions and help to this problem

best regards

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!