Learning CryptLex, Stuck with a grace period over code

Hi , I’m trying to get started with Cryptlex and licensing in general for me. I’ve got a C++ application and we’re statically linking the LexActivator. I made a test license and things were working on Friday, today I kept getting a return code of LA_GRACE_PERIOD_OVER(22) from IsLicenseGenuine. I’ve tried using a different key but when I call GetLicenseKey it still uses the previously entered key.

Unfortunately I’m kind of stuck at this point. I’m sure I’m doing something incorrectly and need help figuring out what. Thank you.

Hi Christopher,

The IsLicenseGenuine() function verifies the license activation data locally (from the disk). After verifying locally, it schedules a server check in a separate thread.

After the first server sync it periodically does further syncs at the server sync frequency set for the license till the app is running.

In case server sync fails due to network error, and it continues to fail for fixed number of days (grace period), the function returns LA_GRACE_PERIOD_OVER instead of LA_OK.

Now either ask your customer to connect to the internet, or treat LA_GRACE_PERIOD_OVER as success code.

You can also allow infinite grace period by setting “Server Sync Grace Period” property of license to “0”.

Thank you for replying, The computer in question is my own, I’m implementing the license management so this is just for testing purposes. What is the grace period for?

Also, how do I change a license key? I know deactivating a license needs to be done through the web portal/api, but if a user has a new key how do they change it? I’ve run into this difficulty during my testing even though I don’t anticipate it happening much in the field.

The grace period is to enforce server sync for your customers if that matters in your use-case. Else this should be set to 0.

You can just call SetLicenseKey() followed by ActivateLicense(), or better would be to call DeactivateLicense() function first before activating the new license key.