Functions and Directives

Function AutomationRequestLicenseKey() Foundation

Requests the license key of a COM/ActiveX component

The function is deprecated. Use the class method AutomationObject():requestLicenseKey()instead.

Syntax
AutomationRequestLicenseKey( <cProgId> | <cCLSID> ) => cKey
Parameters
<cProgId>
<cProgID> is the ProgID identifying a COM/ActiveX component whose license key is requested.
A ProgID has the following syntax:
ApplicationName.ObjectName.Version 
Specification of (.Version) is optional. It defaults to the highest version number installed on the system if omitted.
The ProgIDs of the COM/ActiveX components installed on a computer are listed in the registry at the key HKEY_CLASSES_ROOT.
<cCLSID>
<cCLSID> is the class ID that can be used as an alternative to <cProgID>. Class IDs are stored in the registry as subkeys of a ProgID.
Return

The function returns the license key required for creating the COM/ActiveX component. An empty string ("") is returned if the COM/ActiveX component does not require a license.

Description

Some COM/ActiveX components require a license key for being created. A license key is a character string that must be passed to functions such as CreateObject()or methods such as XbpActiveXControl:Create().

If a licensed COM/ActiveX component is installed on a computer, the control's license key can be queried using the function AutomationRequestLicenseKey(). The character string returned by this function can then be pasted into .PRG code or used at run-time to create instances of the COM/ActiveX component.

The licensing scheme may vary with the vendor of the COM/ActiveX component in question. However, in most cases the license obtained by the application developer also needs to be shipped with the Xbase++ application. Generally, a COM/ActiveX component that needs a license key to be specified for usage on a development machine also needs a license to be supplied on a client machine. In this case, the character string with the license key must be incorporated into either the application's source code, or it must be defined in the application's resource. In both cases, the function AutomationRequestLicenseKey() can be used to determine the license key string for the COM/ActiveX component.

Please note that some vendors of COM/ActiveX components distinguish between licenses obtained for development and those valid for installations on client machines. This means that even though the developer obtained a so-called design-time license for usage in a development environment, the object may still have to be registered after installation on a client machine. In this case, a special run-time license may have to be acquired. Please consult the documentation that comes with your specific COM/ActiveX component or control to learn which licensing scheme is applied by the object's vendor.

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.