SetDayIntervalForServerCheck is not working

Hi, I'm new on cryptlex, while I'm using the sample C++ project to do some testing.
While i'm setting the it to 1 day. I still get the license is genuinely activated! even I deactivate the license in Web more than 1 day. Is there any wrong on my script.

status = SetVersionGUID(L"xxxx-xxxx-xxxx-xxxx-xxxxxxx", LA_USER);
SetDayIntervalForServerCheck(1);
SetGracePeriodForNetworkError(10);

Comments

  • Hi,

    If you deactivate the license, and don't consume the license on some other pc, it would get reactivated. You have to revoke the key, if you want to invalidate the license on the client.
  • Hi,

    I tried to activate the license in other machine already. The original machine keep give out the "Product is genuinely activated!" in sample code after 48hrs, even I put SetDayIntervalForServerCheck(1); before status = IsProductGenuine();

    status = SetVersionGUID(L"xxxx-xxxx-xxxx-xxxx-xxxxxxx", LA_USER);
    status = SetDayIntervalForServerCheck(1);
    status = IsProductGenuine();

    if (LA_OK != status) {
    printf("Error code: %d", status);
    getchar();
    return status;
    }

    Anything wrong in the code??
  • Hi,

    Create a license key with validity of 365 days (say).

    Activate your app using the license key.

    SetDayIntervalForServerCheck(1);

    Revoke the key in the dashboard. After one day start your app again, keep it open for atleast 20 seconds. Restart your app and you will see that software is deactivated.
  • Dear there, I'm adding status = SetDayIntervalForServerCheck(1); in the following C++ script based on tutorial script.
    After activation on machine1, we deactivate the license through dashboard, and let machine2 activate the license.
    After a day, machine1 run the program again, and it still fall into "Product is genuinely activated!", is there any problem on my script? Thank you.

    if(LA_OK != status) {
    printf(" Error code2: %d",status);
    getchar();
    return status;
    }


    status = IsProductGenuine();

    #include
    #include
    #include "LexActivator.h"
    #include

    #if _WIN32
    #if _WIN64
    #pragma comment(lib,"x64/LexActivator")
    #else
    #pragma comment(lib,"x86/LexActivator")
    #endif
    #endif

    int main()
    {

    int status;

    status = SetProductFile(L"xxx.dat");
    printf(" SetProductFile status:", status);
    if(LA_OK != status) {
    printf("Error code: %d",status);
    getchar();
    return status;
    }
    status = SetVersionGUID(L"xxxxxxx", LA_USER);
    status = SetDayIntervalForServerCheck(1);
    status = SetGracePeriodForNetworkError(1);

    if(LA_OK != status) {
    printf(" Error code2: %d",status);
    getchar();
    return status;
    }


    status = IsProductGenuine();
    printf(" IsProductGenuine status:", status);
    if(LA_OK == status) {
    printf(" Product is genuinely activated!");
    //status = SetProductKey(L"xxxxxxxxx");
    //status = ActivateProduct();

    }
    else if(LA_EXPIRED == status) {
    printf(" Product is genuinely activated, but license validity has expired!");
    }
    else if(LA_GP_OVER == status) {
    printf(" Product is genuinely activated, but grace period is over!");
    }
    else {

    // Time to buy the product key and activate the app
    status = SetProductKey(L"xxxxxxx");

    if (LA_OK != status) {
    printf("Error code: %d", status);
    getchar();
    return status;
    }

    SetExtraActivationData(L"QM 1.0");
    // Activating the product
    status = ActivateProduct(); // Ideally on a button click inside a dialog
    printf(" ActivateProduct status:", status);
    if (LA_OK == status) {
    printf("Product activated successfully!");
    }
    else {
    printf("Product activation failed: %d", status);
    }

    }
    getchar();
    return 0;
    }
  • You are calling ActivateProduct () after IsProductGenuine () which is incorrect. The ActivateProduct () function should only be called once and not on every restart.
  • When you will restart your app third time then it will show invalid license, because IsProductGenuine () returns the result by validating local data, and also creates a thread to validate on server asynchronously. So it would invalidate data on second start, and when you restart third time the local data will be invalid.
  • I follow your way and it keep give out "Product is genuinely activated!" after few days i remove the license from dashboard. (suppose it would re-check server after a day),
    Could any command I could check when it is validate on server, when it is validate by local data??
Sign In or Register to comment.