Top
PowerCOBOL V11.0 User's Guide
FUJITSU Software

9.7.3 Accessing Objects Using the COBOL *COM Class

NetCOBOL provides a *COM class for working with automation servers. This class provides methods for creating objects, invoking the object methods and accessing the object's properties.

The *COM class can be useful for accessing objects created by other systems where there is no matching POW-???? class.

To access PowerCOBOL objects or controls using the *COM class:

  1. Right click on an unused part of the Form, and select Edit ENVIRONMENT DIVISION from the pop-up menu.

  2. From the sub-menu select REPOSITORY.
    PowerCOBOL opens an edit window for you to type the entries for the REPOSITORY paragraph.

  3. In this window type:

    CLASS  COM  AS  "*COM"

    And close the REPOSITORY window.

  4. In like manner, from the form, select Edit DATA DIVISION, WORKING-STORAGE, and type:

      01 COMNODE  USAGE IS OBJECT REFERENCE COM.
    
  5. Finally, to get an object reference of the appropriate class in COMNODE, you use a call to the routine "POWERCONVTOCOM" (Convert reference to an COM class reference) in your event code.

         CALL "POWERCONVTOCOM" USING NODE1 RETURNING COMNODE.

You can then use the COMNODE item with the functions provided for the *COM class.

NOTE: You should clear COMNODE when you are finished using it by coding:

      SET COMNODE TO NULL.