AXDEFGEN Utility Reference

The ActiveX Definitions Generator (AXDEFGEN) utility is a dialog-based application designed to facilitate the addition of ActiveX controls and COM objects to Windows-based ACUCOBOL-GT programs. AXDEFGEN locates the names of ActiveX controls and COM objects currently registered on the system and generate a COBOL COPY file for the control or object that you select. This COPY file is used by the ACUCOBOL-GT compiler for syntax and parameter type checking as well as efficient code generation. Where the control or object requires additional runtime licensing, AXDEFGEN also creates and embeds the required license key.

AXDEFGEN is located in the \AcuGT\bin directory wherever you installed ACUCOBOL-GT on your machine. If you run AXDEFGEN without command-line parameters, a dialog box appears.


AXDEFGEN dialog box

The dialog box has two tabs: Components and Libraries. The Components tab lists all ActiveX controls and other COM objects that have registered type libraries. The items on this list are derived from the HKEY_CLASSES_ROOT\CLSID registry key and then matched by the Globally Unique IDentifier (GUID) of the type library against the HKEY_CLASSES_ROOT\TypeLib registry entries. The Libraries tab contains a list of libraries derived directly from the HKEY_CLASSES_ROOT\TypeLib registry key. Therefore, some items may appear under both tabs, and some items in the Libraries list may represent collections of items from the Components list. AXDEFGEN generates a COPY file for the entire type library, whether you select the library name from the Libraries list or the name of an individual component from the Components list.

Select the name of an ActiveX control or COM object that you want to include in your COBOL program, then browse to choose an output path and filename for the COPY file. (The extension ".def" is automatically appended to the filename you specify.) When done, click OK to generate the COPY file.

Note: To prevent compiler errors, AXDEFGEN automatically converts any embedded spaces that it finds to hyphens when generating the COPY file, including spaces found in object methods, events, properties, parameters, and enumerators.

Many ActiveX controls and COM objects have documentation available. If they do, the ActiveX Help push button on the right side of this box is enabled. Click the button to read the help file for the selected ActiveX control or COM object. If the ActiveX Help push button is disabled, it means that AXDEFGEN could not locate a help file for the selected control.

If desired, you can execute AXDEFGEN from the command line. It takes two optional command line parameters. The first is the registry name of an ActiveX control or other COM object. The second is the name of the COPY file you want AXDEFGEN to create. For example:

AXDEFGEN MSCAL.Calendar cal.def

creates a COPY file named "cal.def" in the current directory containing the definitions for the Microsoft Calendar Control, which is an ActiveX control registered as "MSCAL.Calendar" in the system registry. Likewise:

AXDEFGEN Word.Application word.def

creates a COPY file named "word.def" in the current directory containing the definitions for Microsoft Word, which is registered as Word.Application in the system registry.

For more information on ActiveX and COM programming, including instructions on what to do with the COPY files generated by AXDEFGEN, refer to Adding ActiveX Controls or COM Objects to Your COBOL Program.