Using Controls as Automation Objects

An ActiveX control is a standard automation object with interfaces to handle the Graphical User Interface (GUI) requirements. As a control can be defined so that it does not require a form in which to live, some ActiveX controls can be treated as standard automation objects. To use such a control outside a form, the makeAutomationObject method is called to create the ActiveX object after an instance of the Jade control has been created but before that control is added to a form. When this has occurred, the control can then be treated as any other automation object.

The following example assumes that you have imported the Microsoft SysInfo control (that is, sysInfo.ocx) as an ActiveX control. This example creates a Jade control instance and calls the makeAutomationObject method instead of adding the control to a form.

createSysInfoAsAutoObject();
vars
    x : SysInfo;
begin
    create x transient;
    x.makeAutomationObject;
    write x.oSVersion;
    write x.oSBuild;
    delete x;
end;