File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other JSE/JEE APIs and the fly likes Access Java application message loop from JNI code. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Reply Bookmark "Access Java application message loop from JNI code." Watch "Access Java application message loop from JNI code." New topic
Author

Access Java application message loop from JNI code.

Code Integrator
Greenhorn

Joined: Aug 25, 2010
Posts: 1
Anyone know how to access a Java application's message loop from inside JNI code?

Through the (JNIEnv *env) or (jobject obj) parameters maybe?

I've got an ActiveX dll that I'm running via JNI. The ActiveX dll creates an IP server on a separate thread. When another process connects to the IP server I need to PostMessage (MS Windows term) from this IP server thread to the thread that the Java application is running on.

It appears the Java application's message loop is not present or available in the JNI code and consequently the message is never posted from the IP thread to the JNI / Java App thread.

Of course I can manually add a message loop to the JNI code and the PostMessage works just fine. But then the message loop is executing and the Java application is effectively blocked and becomes unresponsive because the JNI method call never returns as its busy running this while loop doing a GetMessage --- DispatchMessage inside the ActiveX dll.

Thanks.

 
 
subject: Access Java application message loop from JNI code.
 
MyEclipse, The Clear Choice

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture