Update OLE Controls

This article has four sections:
To see:

Overview of the sample

The OLEControls sample demonstrates Java updating OLE controls. The OLE control is created using an <object> tag on the HTML page.

About the server

The Outline control MSOUTL32.OCX is an ActiveX control. It displays hierarchical information. Its programming interface is much simpler than the Windows® common control, the TreeView.

About the sample

This sample features a simple HTML page with a Java applet that displays employee information from a database. The information includes the manager of the employee. There is an Outline control on the page, as well. The applet controls the Outline control so that the Outline control displays the direct reports of the employee.

About security

COM components can access any system resources. As such, they are both very powerful and potentially very dangerous. In the Java virtual machine (VM) in Microsoft Internet Explorer 3.0 only trusted class files can use COM components. Class files from digitally signed CAB files are trusted.

If the HTML file is run from Microsoft Developer Studio, the class files are also trusted. This can be very helpful during applet development. However, to deliver your applet to other users, you must put it in a signed CAB file.

When run as an application, the class file must already be on your machine. When run as an applet, the class file may be downloaded to your machine. There is a potential security threat running downloaded software. To run a Java applet that uses COM components, the applet code must be trusted. For more information on trusted class files, see the CabAndSign sample.

Return to the top of this article.


How to use this sample

To run the OLEControls sample:

  1. Register MSOUTL32.OCX, the OLE control used in this sample.
    See
    Registering an OLE Control.
  2. Create a Java interface for the COM component.
    See Creating a Java Interface for a COM component.
  3. In Developer Studio, build the applet.
  4. In Internet Explorer, set the security method to Medium.
    See Setting the Security Method in Internet Explorer.
  5. In Developer Studio, run the applet.
    If this is the first time you have run the applet, Developer Studio will prompt you for the name of the class. Type orgchart.
Return to the top of this article.

Troubleshooting this sample

If you get the warning message potential security violation avoided:

If you get the error message java.lang.VerifyError:

If you get the error message ClassNotFoundException:

If you get the error message Scripting error: 8000ffff:

If you do not see the outline control on the HTML page:

Return to the top of this article.

Files in this sample

This sample includes the following files.

Project files:

Support files: Return to the
top of this article.