Exposing a class as a COM class is a way of creating powerful and reusable applications. By selecting a class as a COM class, the class and its public methods can be accessed from other applications and programming languages. The COM Classes tab of the <Project> Properties dialog box allows you to specify which public classes in your project should be exposed as COM classes. Once a class has been defined as a COM class, Visual J++ creates a type library for your project's COM classes so that it can be accessed by other applications and registered as a COM object in the system registry.
The COM Classes tab also allows you to use an existing type library to expose your project's classes or to create class templates for existing type libraries or embedded COM object ActiveX controls. A COM template allows you to use Java source code to implement COM components that are described in type libraries or pre-existing COM components. If you have a type library or COM component that you wish to implement using Java, you can select the type library or COM component from the list and Visual J++ will build the template code in your project. You can then implement each of the methods provided by the templates, and compile to create a COM component.
To make a class in your project a COM class
The <Project> Properties dialog box appears.
Note Any settings made in the COM Classes tab of the <Project> Properties dialog box are not affected by changes in the build configuration settings in the Configuration list.
To use an existing type library
The COM Templates dialog box appears.
Visual J++ creates a package directory in your project directory and also creates the template classes in the new package directory.