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:
Right click on an unused part of the Form, and select Edit ENVIRONMENT DIVISION from the pop-up menu.
From the sub-menu select REPOSITORY.
PowerCOBOL opens an edit window for you to type the entries for the REPOSITORY paragraph.
In this window type:
CLASS COM AS "*COM"
And close the REPOSITORY window.
In like manner, from the form, select Edit DATA DIVISION, WORKING-STORAGE, and type:
01 COMNODE USAGE IS OBJECT REFERENCE COM.
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.