how to get date of last validation of USK after activationAnswered

HI Support Team,

we need some information on fetching how to get when was the last time the USK is validated after activation of the key. 

Regards,

Narayana

, edited
Answer

We don’t collect that information. Use TA_IsGenuineEx() as shown in the examples and your app will get re-verified every X days with Y grace period.

, edited

Hi Wyatt,
thank you. 
i have a couple of questions to ask:

i want to display a message like “Days left for Revalidating” on Application Starting:

first step: calling sGenuineEx(_Guid.c_str(), &options);

second step: calling TA_GenuineDays(Guid.c_str(), nDaysBetweenChecks ( value 10), nGraceDaysOnInetErr( value 0 days), 0, (char*)'0')

when ever i call these 2 functions for any key i am getting 27 days are genuine days remains new key or old key.





 

A whole lot more information is needed. Honestly, just following the examples is the best thing to do (we show the optimal workflow).

But if you're trying to do something fancy, please provide enough information: https://wyday.com/limelm/help/faq/#useful-reports

my requiremnet is like below,
when application starts, check how many days left for validating the Key with Servers and alert the user for to do. but the condition is nDaysBetweenChecks  we are using 20 days and user should get alter from 18th day. Once the count enters 20th day, key should be deactivated.

in between, if user connects to internet, let is be on 19th day or 10th day or 2nd day, then the nDaysBetweenChecks should be reset to 20 again.

 and below steps
first step: calling sGenuineEx(_Guid.c_str(), &options);

second step: calling TA_GenuineDays(Guid.c_str(), nDaysBetweenChecks ( value 20), nGraceDaysOnInetErr( value 0 days), 0, (char*)'0')

we are using TurboActivate 4.4.4.0 and below 

Regards

Narayana.

Just use TA_IsGenuineEx() as written (and the examples as written). They already do what you're looking for.

Hi Wyatt,

Good Day!!

I have tried the TA_ISGenuineEX() and i am getting the status of key.

Now i tried to find genuine days using below code shown in image.

Regards

Narayana

HRESULT hr = TA_IsGenuineEx(taHandle, &opts);

       const unsigned int a = TA_GenuineDays((uint32_t)_versionGuid.c_str(), opts.nDaysBetweenChecks, opts.nGraceDaysOnInetErr,0, (char*)'0');

       ////when i use above i am getting 27

       if (hr == TA_OK || hr == TA_E_FEATURES_CHANGED

           || hr == TA_E_INET || hr == TA_E_INET_DELAYED)

       {

           // your app is activated and genuine

           numRemainingDays = TA_GenuineDays(taHandle, opts.nDaysBetweenChecks, opts.nGraceDaysOnInetErr, 0, (char*)'0');

//// when i am using this format i am getting error like Exception thrown at 0x79B063CC (TurboActivate.dll) in app.exe: 0xC0000005: Access violation writing location 0x00000000.
 

}

Everything about this code is wrong:

const unsigned int a = TA_GenuineDays((uint32_t)_versionGuid.c_str(), opts.nDaysBetweenChecks, opts.nGraceDaysOnInetErr,0, (char*)'0');

I would say just follow our examples and don't try to do anything fancy.

Hi Wyatt, 
thank you for update.
1) 
i have followed this link:
Using TurboActivate with C, C++, & Objective-C • LimeLM (wyday.com)  
and how to find how many days left in Y days before going to deactivation?
( Handling the case where the customer has not re-verified with the server in X + Y days   )

2)
 TA_GenuineDays(uint32_t handle, uint32_t nDaysBetweenChecks, uint32_t nGraceDaysOnInetErr, uint32_t * DaysRemaining, char * inGracePeriod)
how i need to fill the parameters for this if DaysBettenChecks is 30 and GracePeriod is 90

Regards

Narayana

The handle should be like all the other functions that use the handle.

The opts.nDaysBetweenChecks, opts.nGraceDaysOnInetErr are correct.

uint32_t * DaysRemaining, char * inGracePeriod are pointers to variables that will hold the result. I.e. the thing you're looking for. Not null pointers (hence the crash) or pointers to a constant literal (which I believe is undefined behavior, and likely also will crash your app).

So, declare the variables and pass them to your function:

uint32_t days_remain_result = 0;
char in_grace_period = 0;
HRESULT hr = TA_GenuineDays(ta_handle, opts.nDaysBetweenChecks, opts.nGraceDaysOnInetErr, &days_remain_result, &in_grace_period);

if (hr != TA_OK)
{
    //TODO: you've got an error, stop here -- don't barrel onwards.
}
else // TA_OK
{
    //TODO: now you can safely read the values for `days_remain_result` and `in_grace_period`
}
, edited

Hi Wyatt

Thank you for the input. It helped me a lot.

i am able to excute every thing good with code debugging. But when i generate package and test, i am getting error message like “TA_E_TRIAL_EXPIRED”. 

The key is getting activated successfully through code debug but when used in app.exe returing the trail expired error.

Even a newly created key

Regards

Narayana

, edited