Creating a Java Description of COM Components

This article has two sections:
See the readme.

What is JavaTLB?

JavaTLB is the underlying tool used by the Java Type Library Wizard to create Java descriptions of COM components. JavaTLB reads type library information from .TLB, .OLB, .OCX, .DLL, and .EXE files and creates Java descriptions of the objects in the type library. The Java Type Library Wizard can only process type libraries that are registered. Since the type library for this sample is not registered, you cannot use the Java Type Library Wizard.

In this sample, you create a Java COM component (server). To make this server available as a COM component, the class must implement a COM interface. EUCLID.ODL describes a COM interface for the CEuclid class. The CEuclid class implements the COM interface IGCD.

Return to the top of this article.


Using JavaTLB

To create a Java description of COM components:

  1. Create a command window.
    From the Start menu, select Programs.
    Select MS-DOS Prompt or Command Prompt, depending on the version of the operating system.
  2. In the command window, include the Developer Studio BIN directory in the path.
    This directory is c:\msdev\BIN, where c:\msdev is the directory where you installed Visual J++.
       set path=%path%;c:\msdev\bin
  3. In the command window, navigate to the sample directory.
  4. In the command window, run JavaTLB.
       javatlb euclid.tlb
Return to the
top of this article.