Contents - Index


4.4.5 Technical Reference

This reference lists all of the properties, methods and events of the Sheriff ActiveX Control.

Properties

The properties are listed in their categories, namely Company Info, Product Info, Trial License and Miscellaneous.

Company Info

All of the properties in this category are for providing information about your company. This information is used and displayed on the licensing dialog box if Auto Authorize or/and Auto Renew options are set on.

  1. CompanyName
  2. Address1
  3. Address2
  4. City
  5. Country
  6. Post Code
  7. Phone
  8. Fax
  9. Email
  10. WebSite

These properties are self-explanatory.

Product Info
  1. ProductName
  2. The name of your product.

  3. ProductID
  4. The ID of your product. Sheriff ActiveX Control comes with a pre-defined evaluation product ID that can be used for your evaluation and testing. You need to obtain a product ID of your own if you decide to use Sheriff in your commercially released product.

  5. AutoTrial
  6. Instructs Sheriff ActiveX control to automatically issue a trial licence.

  7. AutoAuthorize
  8. Instructs Sheriff ActiveX control to automatically authorize a licence with a built-in licensing dialog box. Your company information will be displayed in the licensing dialog box as well as the user reference code, licence key and publisher's data.

  9. AutoRenew
  10. Instructs Sheriff ActiveX control to automatically renew a licence with a built-in licensing dialog box. Your company information will be displayed in the licensing dialog box as well as the user reference code, licence key and publisher's data.

  11. HeartbeatTime
  12. Defines the interval of heartbeating time. Heartbeating is a way of notifying Sheriff that the application is alive and, in the case of unit metering, updating Sheriff of the usage of the unit meter.

  13. ReclaimTime
  14. Defines when Sheriff can reclaim a dead licence. A dead licence is the licence that was requested and held by an application but its heartbeat has ceased for a period of time that is longer than the HeartbeatTime.

Licence Info
  1. Type
  2. Type of the licence. Its values are explained in the SDK and can be found in the slsapi.bas. With ActiveX control you don't need to manipulated it directly, instead you will want to set the following properties such as IsReusableKey, IsTimeMeter etc which are a breakdown of the possible values of the licence type.

  3. IsReusableKey
  4. A reusable licence key makes the licence reusable on the same PC given that the hardware components do not change. A reusable licence key allows the user to recover his/her licence in the event that the licence is damaged or lost by accident. Typically you would only want to issue a reusable licence key with time or expiration restrictions.

  5. IsReusableRef
  6. Sets the user reference code to be reusable.

  7. IsExportable
  8. Defines whether or not a licence is exportable.

  9. IsStandalone
  10. Defines whether a licence is a standalone or network licence. A standalone licence is locked to the machine from which the licence is authorised and therefore is not sharable with other users.

  11. IsTimeMeter
  12. Define whether the licence is limited by a number of days that is defined by the Meter property.

  13. IsUnitMeter
  14. Define whether the licence is limited by a number of units that is defined by the Meter property.

  15. IsSetExpiration
  16. Defines whether the licence will expire by the predefined date that is set by the EndDate property.

  17. IsSetCoUsers
  18. Define the maximum concurrent users that can use the licence simultaneously.

  19. Meter
  20. Defines the maximum number of days if the IsTimeMeter is set, or the maximum number of units if the IsUnitMeter is set.

  21. EndDate
  22. Defines the expiration date if the IsSetExpiration is set.

  23. CoUsers
  24. Defines the maximum number of concurrent users if the IsSetCoUsers is set.

  25. AccessKey
  26. Defines the feature access level.

  27. State
  28. Returns the current state of the licence when QueryLicenceInfo method is called. Please refer to the API Reference for its description.

  29. StartDate
  30. Returns the start date or purchase date of the licence when QueryLicenceInfo method is called.

  31. MeterUsage
  32. Returns the usage of the meter when QueryLicenceInfo method is called.

  33. ActiveUsers
  34. Returns the number of active users when QueryLicenceInfo method is called.

  35. Publisher Data
  36. Sets or returns the publisher's data.

Miscellaneous
  1. LicencePath
  2. Defines the location of the licence files. If LicencePath is not given, Sheriff ActiveX control will create and locate licence files in the directory where it is installed.

  3. UserName
  4. Provides the name of the user who is running the application.

  5. MajorVersion
  6. The major version number of the control

  7. MinorVersion
  8. The minor version number of the control

Methods

Apart from those methods that return boolean, all of other methods return an error code that indicates success or failure. A list of error codes can be found in the SLSAPI.bas and are explained in the API reference (see on-line help: Sheriff.chm).

  1. CheckLicence() As long
  2. Call this method to check licence and run Sheriff ActiveX control in Automatic Mode.

  3. GetReference(byref ReferenceCode As String)
  4. To get the user's reference code.

  5. SetLicence(ReferenceCode As String, LicenceKey As String)
  6. To issue a licence with the user's reference code and its licence key.

  7. RequestLicence(byref AccessKey As long) As long
  8. To request a valid licence to run the application. AccessKey returns the feature access level defined by the licence.

  9. UpdateLicence() As long
  10. To update licence on heartbeat.

  11. ReleaseLicence() As long
  12. To release licence as soon as the application does not need the licence.

  13. RequestLicenceUnits(UnitsReserved As long, byref UnitsGranted as long,
  14. byref AccessKey as Long) As long

    To request a valid licence and reserve a number of units to run the application. AccessKey returns the feature access level defined by the licence.

  15. UpdateLicenceUnits(UnitsReserved As long, UnitsConsumed As long,
  16. byref UnitsGranted As long) As long

    To update licence on heartbeat with the number of units consumed. In addition, to modify the number of units the application wants to reserve.

  17. ReleaseLicenceUnits(UnitsConsumed As long) As long
  18. To release licence when the number units has been consumed in the session.

  19. IsExportableLicence() As Boolean
  20. IsStandaloneLicence() As Boolean
  21. IsReusableLicence() As Boolean
  22. IsReusableReference() As Boolean
  23. IsLicenceValid() As Boolean
  24. IsProductLicensed() As Boolean
  25. IsProductRegistered() As Boolean
  26. IsProductInstalled() As Boolean
  27. IssueLicence(bstrChallengeData As String) As Long
  28. To issue a licence. The licence features should be set via the licence properties such as Meter, EndData etc. You need to support challenge to be able to issue a licence. Please refer to the Advanced demo for codes of how to make a challenge.

    IssueLicence will also set the publisher's data.

  29. ImportLicence(bstrReferenceCode As String, bstrImportKey As String) As Long
  30. To Import a licence.

  31. ExportLicence(bstrReferenceCode String,byref bstrExportKey As String) As Long
  32. To export a licence.

  33. RemoveLicence(bstrChallengeData As String ,Options As Long) As Long
  34. To remove a licence. The options are explained in the API reference. You need to support challenge to be able to remove a licence. Please refer to the Advanced demo for codes of how to make a challenge.

  35. TerminateLicence(byref bstrTerminateCode As String) As Long
  36. To terminate a licence.

  37. QueryLicenceInfo() As Long
  38. To query current licence information. Licence information is returned in the licence and licence info properties, such as Type, State, EndDate, StartDate etc.

    QueryLicenceInfo will also return the publisher's data.

  39. GetLastError(byref LastError As long) As Long
  40. Returns last error code.

  41. GetLastErrorMessage(byref ErrorMessage As String)
  42. Returns last error message

  43. GetErrorMessage(ErrorCode As Long ,byref ErrorMessage As String)
  44. To retrieve the error message given an error code returned by any other method.

  45. GetChallengeData(byref bstrChallengeData As String) As Long
  46. Used to make a challenge when calling IssueLicence or RemoveLicence.

  47. GetStatusCode(byref bstrStatusCode As String, byref ErrorCode As Long) As Long
  48. To retrieve the current status code of the licence.

Events

Sheriff only fires up the following event messages when running in the Automatic Mode.

  1. OnTrial
  2. OnStart
  3. OnChallenge
  4. OnHeartbeat
  5. OnError
  6. OnProductNotLicensed
  7. OnProductNotAuthorized
  8. OnLicenceExpired
  9. OnTooManyUsers

Please refer to the previous sections for a description of these messages.