Using LexFloatClient with C, C++ & Objective C
Last updated
Last updated
First of all, login to your Cryptlex account and download the LexFloatClient library for Windows, macOS, or Linux:
The above download package contains the library (shared as well as static) which you will be using to add licensing to your app.
After you've added a product for your app in the admin portal, you will need to do the following things:
Note the product id for the product (from the actions menu in the table).
Download the example project from .
The product id is the identifier of your product that is to be used in the code. The product id of the LexFloatServer and LexFloatClient must match.
LexFloatClient example project for C contains the LexFloatClient.h header file. In addition to that, it includes the LexFloatClient.lib file required in the case of Windows. It contains all the LexFloatClient API functions needed to add licensing to your app.
Depending on the platform you are targeting (x86 or x64) you need to link the respective LexFloatClient.dll with your application.
LexFloatClient has a dependency on VS2015
runtime on Windows. On the target machines where you will deploy your app, you can install the VS2015
runtime, if not present, using the link:
The first LexFloatClient API function you need to use in your code is SetHostProductId()
. It sets the product id of the product you will be adding licensing to.
To receive a floating license, you will use SetHostUrl()
, SetFloatingLicenseCallback()
and RequestFloatingLicense()
LexFloatClient API methods. It sets the LexFloatServer address, the callback for status notifications, contacts the server and receives the floating license.
The above code can be executed every time user starts the app or needs a new license.
License lease automatically renews itself in a background thread. When a license is renewed or fails to renew, the callback is invoked (from the background thread).
When your user is done using the app, the app should send a request to free the license, thereby making it available to other users. If the app doesn't, the license becomes useless (zombie) until lease time is over.
The above code should be executed every time user closes the app.
In case you need more help with adding LexFloatClient to your app, we'll be glad to help you make the integration. You can either post your questions on our or can contact us through .