ActiveX Controls, License Files, and Compound Storage Files

Top  Previous  Next

ActiveX Controls and License Files

Many ActiveX controls operate on two levels: the development/design level, and a more limited end user level. Typically, a developer buys a license which allows him to operate the control at the design level and to redistribute the control at the end user level. This type of license is often enforced through an associated license file. (.LIC or .LPK). That is, the license file must be present at design time to successfully manipulate the properties of the ActiveX control during application development; but it need not (and should not) be present at runtime to support the more limited end user operation of the control. Thus, the ActiveX control (.OCX and/or .DLL) may be distributed with the application to end users, but the license file need not be distributed, and in fact, cannot legally be distributed under the terms of the typical license agreement.

Clarion Win32 and License Files

Clarion Win32 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 a compound storage file (.OLR) that contains an instance of the ActiveX control.

Use the OCX Property32 Program to create the compound storage file. Then you can use the Window Designer 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 2:

Outside the WINDOW structure, name a compound storage file that contains an instance of the ActiveX control.

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

Method 3 (not for use with distributed applications):

Outside the WINDOW structure, name the ActiveX control. This method requires the presence of a license file at runtime--a violation of the typical license agreement; therefore you cannot use this method for distribution to end users.

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

 

Benefits of Compound Storage Files

Compound storage files are files that contain one or more OLE or ActiveX objects, including any special property settings for those objects such as fonts, colors, sizes, initial values, etc. Microsoft established the standard format for these files, which in the Clarion for Windows implementation have a file extension of .OLR (by convention only).

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. 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