Richard Blouin
2005-02-03 15:04:54 UTC
Here's the problem: A COM server from a third-party has Advise and Unadvise
methods for hooking COM event handlers. I coded the COM event handlers and
put them in a DLL. Everything works fine when I test my DLL with a Win32 app
(written in Delphi). The COM event handlers get called, my code runs, the
whole thing is perfect.
Now, I have a Java Native Interface portion in my DLL so I can use this
third-party COM server from Java. Outgoing calls 1) from the JVM, 2) down
into the JNI layer, 3) out through COM to the 3rd-party COM server and 4)
back through the COM event handlers, 5) back into the JVM work fine. What
does not work with Java are *spontaneous* COM events originated in the
3rd-party COM server, ie 1) from the COM server, 2) to the COM event
handlers. They work fine in Win32, but not in Java.
It seems that the JVM is somehow blocking incoming COM calls. If the
3rd-party COM server issues a callback to a COM event handler, the event
only fires when the JVM "re-enters" COM by an outgoing call to the server.
Any help would be appreciated.
methods for hooking COM event handlers. I coded the COM event handlers and
put them in a DLL. Everything works fine when I test my DLL with a Win32 app
(written in Delphi). The COM event handlers get called, my code runs, the
whole thing is perfect.
Now, I have a Java Native Interface portion in my DLL so I can use this
third-party COM server from Java. Outgoing calls 1) from the JVM, 2) down
into the JNI layer, 3) out through COM to the 3rd-party COM server and 4)
back through the COM event handlers, 5) back into the JVM work fine. What
does not work with Java are *spontaneous* COM events originated in the
3rd-party COM server, ie 1) from the COM server, 2) to the COM event
handlers. They work fine in Win32, but not in Java.
It seems that the JVM is somehow blocking incoming COM calls. If the
3rd-party COM server issues a callback to a COM event handler, the event
only fires when the JVM "re-enters" COM by an outgoing call to the server.
Any help would be appreciated.
--
Richard Blouin
Richard Blouin