This topic provides an outline for developing an ActiveX Windows program, such as Visual Basic, VBScript,
and Active Server Pages, to use the WebSphere ActiveX to EJB bridge to access enterprise beans.
This topic assumes that you are familiar with ActiveX
programming and developing on the Windows platform. Consider the information given in ActiveX to EJB bridge as good programming guidelines.
Why and when to perform this taskTo use the ActiveX to EJB bridge to access a Java class, develop your ActiveX program to complete the following steps:
Create an instance of the XJB.JClassFactory object.
Create Java Virtual Machine (JVM) code within the ActiveX program process, by calling the XJBInit() method of the XJB.JClassFactory object. After the ActiveX program has created an XJB.JClassFactory object and called the XJBInit() method, the JVM code is initialized and ready for use.
Create a proxy object for the Java class, by using the XJB.JClassFactory FindClass() and NewInstance() methods. The ActiveX
program can use the proxy object to access the Java class, object fields,
and methods.
Call methods on the Java class, using the Java method invocation syntax, and access Java fields as required.
Use the helper functions to do the conversion in cases where automatic conversion is not possible. You can convert between the following data types:
Java Byte and Visual Basic Byte
Visual Basic Currency types and Java 64-bit
Implement methods to handle any errors returned from the Java class. In Visual Basic or VBScript, use the Err.Number and
Err.Description fields to determine the actual Java error.