ActiveX Controls with Clarion

 

ActiveX Controls and License Files

Clarion for Windows and License Files

Clarion for Windows lets you implement ActiveX controls in your application with the following methods. All the methods require the presence of the license file at design time and the last method requires the presence of the license file at runtime as well; therefore you cannot use the last method for distribution to end users

Method 1:


Within the WINDOW structure, name the ActiveX control.

For 16-bit controls you can use the Window Formatter to populate an OLE container control (or control template), then select the ActiveX control from the Object Type drop-down list in the OLE Properties dialog.

Method 2:









For 16-bit controls you can use the Window Formatter to create the compound storage file: populate an OLE container control (or control template), select the ActiveX control from the Object Type drop-down list in the OLE Properties dialog, then choose the Custom command on the right-click popup menu.

For 32-bit controls you can use the OCX Property32 Program to create the compound storage file. Then you can use the Window Formatter to populate an OLE container control (or control template) and name the existing compound storage file in the Storage File field in the OLE Properties dialog.

Method 3:



?CalendarObject{PROP:Open} = 'Calendar.OLR\!MeetingSchedule'

Method 4 (not for use with distributed applications):

?CalendarObject{PROP:Create} = 'GraphDemoLib.GraphDemo'


Benefits of Compound Storage Files


You can use compound storage files to reduce and reuse the code needed to implement ActiveX objects in your application. In addition, if you always use compound storage files to implement your ActiveX controls, you will never need to distribute license files to end users in violation of your license agreement.


Compound storage files reduce code because the Clarion for Windows Window Formatter automatically creates compound storage files for 16-bit OLE and ActiveX objects (for 32-bit controls you can use the OCX Property32 Program to create the compound storage file).  You can save the custom properties of a specific object by visually manipulating the object (such as a spreadsheet or a calendar control) with its own powerful and easy to use methods, rather than laboriously hand coding property assignments.  For example, you can format an Excel spreadsheet using Excel menu commands, toolbar buttons, etc., then save the spreadsheet in a compound storage file, then open the spreadsheet in its current state from the compound storage file.

 

Without the compound storage file, you would have to issue a series of Excel property assignments to the Excel spreadsheet object to initialize it to the desired state.   Compound storage files reuse code because you can reference a single compound storage file many times within a single application or from multiple applications. The property settings saved within the compound storage file are reused with each reference.