ActiveX Control Licensing



As a Customer Solutions Analyst in Acucorp Technical Support, I am aware that technical problems frequently arise when an application moves from development into production. Recently I was able to assist a customer with successfully moving their system into production using information gleaned from internal e-mail between two of Acucorp's development staff.

While this information was helpful to customers in Germany using the Microsoft Rich Textbox and in the United States using the Sharp Grid Control, it applies to any ActiveX control regardless of vendor. As ActiveX controls are increasing used in COBOL programs, hope you find it interesting too.

A little Background

All ActiveX controls fall into two categories: licensed and unlicensed.

  • Unlicensed ActiveX controls do not require a license to run and moving your COBOL application from development to deployment is easy and simple.
  • Licensed ActiveX controls require a license be specified in the control's LICENSE-KEY property in your COBOL program. Also, Licensed ActiveX components usually have two license interfaces, one license for design time and another for runtime.
Vendors typically provide a development kit and a separate distribution kit with their ActiveX control. The development kit will often install the control and register it with a design time license automatically. You are not prompted for a license and the control will not require a license key to run. However, when deploying your application with the vendor distribution kit, the component will register demanding a runtime license. Problems may arise for the COBOL program that did not have a LICENSE-KEY property specified for the control when it was created. With Microsoft Rich Textbox, the display statement that creates the control terminated the ACUCOBOL-GT application stating that there was an exception in the component. With the Sharp Grid Control, the error "evaluation version" was displayed.

AcuBench® Users

Most of Acucorp's customers using ActiveX components have purchased AcuBench®, Acucorp's GUI development tool. AcuBench® provides an easy-to-use interface for programmers using ActiveX components.

When an ActiveX control is placed on a screen, AcuBench® queries the ActiveX control for its runtime license and generates the LICENSE-KEY property with the correct value.

As with other programming tools, such as Visual Basic, Delphi and Visual C++, ACUCOBOL-GT queries the ActiveX control for its runtime license key at design time and embeds it into the compiled object. Some tools query and embed the license key into a binary resource unseen by the programmer. ACUCOBOL-GT queries and embeds the license key into the source code itself. The ACUCOBOL-GT compiler then "embeds" it into the object in the same way as other string literals get "embedded".

For AcuBench® users, we recommend that after installing a new or revised ActiveX control license on their development computer, they create an empty project in AcuBench®, insert the ActiveX control into a screen and copy the LICENSE-KEY value from the properties pane into their COBOL program.

Non AcuBench® Users

For customers who choose not to use AcuBench®, deployment may be more complicated. When problems arise, our advice is to contact the vendor of the component for a license, and then supply it for the LICENSE-KEY property. However in some cases, this does not resolve the problem or may be troublesome.

A MSDN article discusses this issue. Go to http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaskdr/html/drgui48.asp and search for "Registering Without a License". The article refers to a utility program LICREQST.EXE, available at http://support.microsoft.com/default.aspx?scid=kb;EN-US;q151771 in the form of a self-extracting archive, that includes both Visual C++ source code and an executable. This utility can be used to obtain a license for an ActiveX control and may be downloaded for free from MSDN. Note that you still need to pay royalties for distribution.

The utility displays the license key both as text characters and in HEX format. The latter is important because a license may consist of low values and other non-printable characters. As the example illustrates, a license key may also start or end with a space. The space is required to have the license work properly.

Do not become alarmed by the term WCHAR. It means that the license is provided as WIDECHAR (each character taking two bytes). Most components only use the standard 1 byte character and do not require it to be provided as WIDECHAR.

Finally, as COBOL trims trailing spaces by default, a tip for handling a license key with trailing spaces, like

77 MY-KEY PIC X(12) VALUE "ABCDE ".

would be to use the STRING phrase and append a line terminator:

STRING "ACBDE " x"00" DELIMITED BY SIZE INTO MY-KEY.

Doing this will preserve the terminating space and the control will accept the low value as string termination.

Your Session will expire in 20 minutes
Notification will be shown in:
600 seconds