This section provides an example of how to incorporate the Sheriff Licence System
Application Programming Interface (SLSAPI) functions in your application, with and without challenge protocol.
Before you begin coding your application,
you will need to obtain your Product ID and Secret Codes, either by purchasing a Serial Number or using the evaluation versions. You also need the Sheriff SDK which includes the dynamic link library SLSAPI.DLL and source code for implementing the challenge/response in your application.
To code the application
- Choose and implement your licensing strategy. For examples, see "Licensing Strategies".
- Incorporate the source codes provided in SDK to prepare the challenge.
- Add calls to the SLS_Request functions in your application to grant licence resources.
- Include periodic calls to the SLS_Update function to notify the licence system that the current licence is still being used.
- Incorporate code to handle errors. Call the SLS_GetErrorMessage function to return a message string that describes the error.
- Call SLS_Release to release licence resources before exiting from the application.