Background

While I was CTO of a company called Inventure, I did a lot of work on calling COM objects from Java using the built-in capabilities of the Microsoft® Java VM. I created a Java-COM Resource Site with some of my experiences using the MS JVM with COM.

However, many people have recently told me that they are now looking to be more VM-independent. Both because the Java 2 platform is gaining momentum (and performance), and because they percieve some uncertainty surrounding the future of Microsoft's Java efforts. One day, someone asked me if it would be possible to provide some minimal level of COM functionality in another JVM (in particular, a Java 2 VM). What they wanted was to call local (EXE) and in-process (DLL) COM Automation servers from any JVM on the win32 platform.

Since I had a couple of weeks between jobs, I couldn't refuse the challenge. The goal was to make the functionality as compatible as possible with the public API that Microsoft® published for their implementation of COM Automation in the MS JVM, so that you could easily upgrade your code to run in the MS JVM as you need to use more COM features in your Java code. So, I set out to implement some of the com.ms.com interfaces (Variant, Dispatch and SafeArray) using JNI.