Develop ActiveX application clients

This topic provides an outline for developing an ActiveX program, such as Visual Basic, VBScript, and Active Server Pages, to use the WebSphere ActiveX to enterprise bean bridge to access enterprise beans.

This topic assumes that you are familiar with ActiveX programming. You should also consider the information given in Overview of the ActiveX to enterprise bean bridge and ActiveX application client programming guidelines.

To develop your ActiveX application client follow these steps:

  1. Create an instance of the XJB.JClassFactory object.
    JClassFactory is the object that handles Java virtual machine (JVM) initialization, class access, and object instantiation. For more information, see ActiveX to enterprise bean bridge classes.

  2. Create JVM code within the ActiveX program process.
    Call 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. For more information, see Java virtual machine initialization tips.

  3. Create a proxy object for the Java class.
    Use the XJB.JClassFactory FindClass() and NewInstance() methods. The ActiveX program can use the proxy object to access the Java class, object fields, and methods. For more information, see Develop Java proxy objects and ActiveX to enterprise bean bridge classes.

  4. Call methods on the Java class and access Java fields via the proxy object, as required.
    For more information, see Call Java methods, Java field programming tips and Threading tips.

  5. Use helper functions to perform data type conversion, if necessary.
    In most cases, ActiveX and Java data types are automatically converted. For more information about type conversion, see Data type conversion values and Array tips.

    However, the Byte and Currency data types cannot be automatically converted, and you need to use helper functions for the conversion. For more information, see Helper methods for data type conversion.

  6. 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. For more information, see Error handling codes for ActiveX application clients.

  7. Configure the environment of your ActiveX application client, and start the application client.
    Before you start your ActiveX application, set up the environment in which the ActiveX client application runs:

  8. If necessary, troubleshoot your application.
    See Enable logging and tracing and View System.out messages.