What are the options for using ActiveX controls?

Question ID : 39
Created on 2009-08-31 at 4:59 PM
Author : Veryant Support [support@veryant.com]

Online URL : http://support.veryant.com/support/phpkb/question.php?ID=39



Question:

What are my options if my application depends on ActiveX controls and I want to continue to use those controls when running on Windows?

Answer:

isCOBOL supports Javabean controls in the GUI, and there are a number of solutions for accessing COM/OLE/ActiveX from within a Java-based application.

We have tested and verified the functionality of ezjcom and comfyj. Both generate java classes to wrap ActiveX objects. We have decided to recommend the Comfyj product since it seems more complete and better supported from a technical point of view. In addition, they charge just for development and not for runtime. 

j-integra does a lot of other things like wrapping .NET, but is not a simple solution. 

There are also free products such as com4j or jacob that can be used, but we prefer a commercial solution that provides support in case of problems.

Veryant can provide a side-by-side example of a program that uses a Microsoft COM object with ACUCOBOL syntax and the same program written with isCOBOL and Comfyj. 

An ActiveX control in the screen section, when converted to a Javabean, looks similar to the following:
       screen section.
       01 mask .
           03 GR-TEST JAVA-BEAN
               LINE 2
               COL 2
               LINES 28
               SIZE 90
               ID GR-ID-TEST
               VISIBLE 1
               ENABLED 1
               CLSID "VSFlexGridContainer"
               EVENT-LIST ("vsflexgrid")
               OBJECT IN FLEXGRID-TEST
               EVENT JAVA-BEAN-EVENT

       java-bean-event.
              if event-type = msg-jb-event
                 set flex-event-obj to event-obj as activex-event
                 evaluate event-data-2
                 when 100
                     display "FSCommand event: command = "

                 end-evaluate
               else
                   set flex-event-obj to event-obj as activex-event
              end-if


Back to Original Question