Skip to main content Skip to footer

Embedding license key for ActiveX controls created at Run Time

When ActiveX controls are created at run-time, there is a need to embed a license key for the controls in the program itself while running the exe else a nag screen will be thrown.

This is not required while dropping controls onto form at design time. In that case the license key becomes embedded into the executable by the development environment only.

In this KB article we will discuss the detailed steps to embed the license key for ActiveX controls.

In order to explain the steps, 'C1FlexGrid8.0' control is used as an appropriate example -

1. The first step is to find the license present in the registry. To do so, run the utility "COMLicenceFinder.exe" . 

2. Check for ComponentOne FlexGrid 8.0 in "COMLicenceFinder".

3. Under the license text, License entry for the control is observed. Copy the entry from there. Please refer to the image below for more clarity.
Image showing highlighted License Entry inside the COMLicenseFinder.exe

4. Now open the attached sample in VB6 and paste the copied license in the codeline mentioned below of Form1: StrLicenseKey = Licenses.Add("VSFlexGrid8.VSFlexGridADO.1?, "Type/paste your license key here")

Licenses.Add method accepts two parameters relative ProgramId of ActiveX Controls and the license. This is the key code line to embed license in ActiveX control.

Relative Program ID can be found using axhelper.exe utility.

5. Now run the sample and see that no nag screen is observed for "C1Flexgrid8.0" even though it has been added at run time.

Below are the steps for how to use axhelper.exe utility :

a) Run the application "axhelper.exe".

b) Select the option "Load ActiveX list from the following Registry key and Press 'ok' button. This will create 'ProgId' for all the ActiveX controls present in the system and the purpose is solved.

An image showing where to get the ProgramID of control values from the axhelper.exe utility

Similarly, licenses can be embedded for other ComponentOne controls created dynamically at run time.

Hunter Haaf