Calling a running Java application

I am writing a Windows DLL which is loaded by a Java application. Usually the Java application calls DLL functions. But at some point, I need to call some method in the Java application (a callback notification). Please let me know how can I do this. I appreciate sample code. Thanks in advance.

-Harish

[317 byte] By [ScreenNameHarisha] at [2007-11-26 14:31:46]
# 1
Hi,You can do that with JNative.You can look a sample source at http://jnative.cvs.sourceforge.net/jnative/JNativeCpp/CallBack.cpp?view=markupHope this will help you,--Marc ( http://jnative.sf.net)
mdentya at 2007-7-8 2:26:59 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2

Normally this would be done using JNI. Check out the tutorial at http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jni.html

Depending on the context you're doing this from in your DLL you may need to attach your current thread before you do the upcall. It's not very hard and you should be able to figure most of it own from the tutorial. There's a lot of other info on JNI available so you might search around a little if you don't find that particular tutorial helpful.

tom

neverevera at 2007-7-8 2:26:59 > top of Java-index,Java HotSpot Virtual Machine,Specifications...