There are two directions using EZ JCom: Java to COM, and COM to Java.
Using EZ JCom in either direction is very straightforward. You give
it Java classes and pick some methods and fields, and it will
give you a COM component that can be easily used by VB, C# or C++.
Alternatively, you give it a COM
object, and it will generate a set of Java source files, plus a command
file for compiling these Java source files. Your Java program can then use
EZ-JCom also extracts the COM
documentation and places it in a Javadoc format, to help you understand
how your COM object works and how to use it.
- instantiate COM objects
- get their interfaces
- call methods provided by the COM objects
- register event listeners for any events the COM objects might generate.
If your COM object needs to have
a visual display (e.g. an ActiveX control, or an OCX), EZ JCom will let you embed it in a Swing or AWT program.
When you download and run EZ JCom, you will see a wizard interface
as shown below.
The COM object can be specified in one of three ways:
- Locate the DLL, EXE, OCX, OLB or TLB file that describes the COM object.
DLL and OCX files are most common. Sometimes, a separate TLB file contains
the description. For stand-alone servers, the file may be an EXE file.
- Search from the list of all registered COM objects.
- Specify the Prog-ID of the COM object. This is typically
a string of the form
Once the COM object has been specified, you will be prompted
for a package name,
an output directory, and the name you want to use for the "JNI DLL".
The "JNI DLL" is a file that will be used as the bridge between
Java and your COM object. For evaluation versions, EZ JCom
will further prompt you for the steps required to build
your JNI DLL.
Once all this is done, simply compile the Java files and use them!
EZ JCom will generate command files that can be used for
the compilation, and also for generating Javadoc.
Once the generated class files (or a jar file containing them) have
been placed in your CLASSPATH, you can use them from any Java program
or IDE. Calling the COM object now is as simple as calling
any other Java API!
The EZ JCom documentation is available for review, online at
(This documentation is also included in the evaluation download.)