Licensing
The ActiveX Control has four built-in licensing levels controlled by the Level property.
The default level is Unlicensed.
Only a small number of system housekeeping Methods and Commands are available at this level. The Unlicensed level is useful for starting an application before choosing other levels.
Note: If the application is written using Visual Basic then the ActiveX Control will have been created before the Form_Load event so the Level property can be set here.
The property can be tested immediately after being set. Any discrepancy from the intended value indicates a licence failure; in such an event the LicenceError event will be called.
At run-time the licence is tested periodically at the start of Method and each time the Level property is changed. This prevents swamping the licence (and potentially the network) if a network licence is in use.
Note: If an error occurs when changing from unlicensed to licensed the Level property reverts back to unlicensed.
For development with the Cadcorp ActiveX Control OCX, Cadcorp will issue you with a unique licence file and unique LicenceKey and LicenceSuffix.
The LicenceKey and LicenceSuffix are unique to each distributor or user of the code.
The combination of both properties ensures that an ActiveX runtime licence supplied for use with the application can only be used by that distributor.
The same LicenceKey and LicenceSuffix can be used within any applications written by the distributor.
The ActiveX Control LicenceKey and LicenceSuffix properties are shared between all ActiveX Control instances in a single program for compatibility with the Level property.
Before you set the licence level, ensure you add these two additional properties:
SisObject.LicenceKey = licencekey"
This is a string value supplied by Cadcorp. To work, it must match details in the licence file.
Cadcorp uses this string to program all licences supplied to your organisation. If using a .NET environment, remember to obfuscate your code to protect this information.
SisObject.LicenceSuffix = "licencesuffix"
This will be your organisation name or initials as a unique code supplied by Cadcorp. It must match details in the licence file to work. Cadcorp will program all licences supplied to your organisation with this string. If you are working in a .NET environment, remember to obfuscate your code to protect this information.
Cadcorp recommends adding this line of code to enable both standalone and network licensing options:
SisObject.SetStr (SIS_OT_SYSTEM, 0, "_SentinelRMSServerList$", "CADCORP_LICENCE_SERVER_LIST")
This line of code instructs the application to do the following in this order:
- Check for a local licence file.
- If no local licence is found then look for a network licence.
- If the CADCORP_LICENCE_SERVER_LIST Windows Environment Variable value is set on the client machine, this will tell the application the location of the Network Licence Server(s).
- If no CADCORP_LICENCE_SERVER_LIST Windows Environment Variable value is found, check the network for Network Licence Servers and use the first licence available.
Note: The CADCORP_LICENCE_SERVER_LIST Windows Environment Variable can hold a list of servers separated by a tilde symbol (~) and replaces the previously used variable LSHOST which only held a single value.
If you set the CADCORP_LICENCE_SERVER_LIST Windows Environment Variable on the client machine to the IP address of the network licence server this is the most efficient way of contacting the Network Licence Server.
TIP: Refer to System Variables for information on Sentinel licensing features.
In summary Cadcorp recommend that the following code is used in SIS Control OCX applications to provide flexible licensing:
SisObject.LicenceSuffix = "licencesuffix"
SisObject.LicenceKey = "licencekey"
SisObject.SetStr (SIS_OT_SYSTEM, 0, "_SentinelRMSServerList$", "CADCORP_LICENCE_SERVER_LIST")
SisObject.Level = SIS_LEVEL_MODELLER
All OCX applications that are to run on SIS will need these alterations to be made to the code and be re-issed as new applications.
Note: The system property "_SentinelRMSServerList$" sets the location of the licence server, it can be an IP Address or a Machine name.
If you are using Redundant Licence Servers this value is set to CADCORP_LICENCE_SERVER_LIST .
This means the Windows Environment Variable CADCORP_LICENCE_SERVER_LIST must be set to a list of redundant servers.