Use the Import ActiveX Control dialog to select an installed ActiveX control that you want to use in your application. The dialog will build the necessary class wrapper and register the class so that it can be visually modeled in the Studio.
You can load this dialog by selecting the “Import COM ActiveX” option from the “Class” tab page in the “Create New” dialog (File / New / Class).
To import an ActiveX control follow these steps…
For each control that you select, you can decide to create it as a regular class or to make it data-aware class. Check the box in the "Data-Aware" column for each control that you want generated as a data-aware class.
Many ActiveX components support the concept of a default/bindable property. When you check the data aware box, the class generator will generate the wrapper class so that the control's default/bindable property can be bound to a Table.Column value from a DataDictionary object.
For more information refer to: Data Binding
The Studio generates a default class name for each control that you import. The default name is based on the Control's name with prefix of "cCom". e.g. if you import the Microsoft calendar control the default class name would be cComCalendar. Prefixing the class name with "cCom" helps you to identify all of your COM wrapper classes. It also helps you to avoid name clashes with any existing DataFlex classes.
If the class is to be data-aware, the default prefix becomes a "cComDb". This different prefix allows you to build applications with a mix of data aware and non data-aware versions of the same ActiveX control.
You may change the of each ActiveX wrapper class by editing the default class name(s) in the grid.
The Studio will provide a default name to write the DataFlex class to. You may change this name and path, but you should do so with caution, ensuring that the compiler will find the path. The default name of the package containing the class depends upon how many classes you are creating. If you are only creating one class, the name of the package will be the name of the class. If you are creating multiple classes, it will be the name of the ActiveX library, with a ".pkg" extension.
Choosing a group name instructs the Studio where to install the control on its Class Palette. The drop-down list will show the existing group names.
You can create a new page by typing a new name, if you wish.
Click OK to generate the DataFlex wrapper classes for your controls. When the Classes are generated, the appropriate .DFC files will be created, one for each class, and the bitmaps will be extracted from the ActiveX library and placed on the Control's Palette for you. If you created a data-aware control, a small "data-aware" image will be superimposed on the image for you that matches the existing DataFlex-supplied data-aware classes.
Programming with ActiveX Controls