UseTrial() error code

Hey guys!Having trouble that just started recently when calling this in Obj-Chr = UseTrial([GUID UTF8String]);

hr is returning the error code 16 instead of TA_OK like before on multiple OS X systems

any ideas what that is?

thx!

Steve

Hey Steve,

16 is 0x10 in hex, which if you look in TurboActivate.h you'll see means TA_E_INVALID_FLAGS:

/* MessageId: TA_E_INVALID_FLAGS

MessageText:

The flags you passed to CheckAndSavePKey(...) or UseTrial(...) were invalid (or missing). Flags like "TA_SYSTEM" and "TA_USER" are mutually exclusive -- you can only use one or the other.*/

That's because you didn't pass in a flag (you passed in a version GUID). Your call should be like this:

hr = UseTrial(TA_SYSTEM);

Awesome!that fixed it!

so strange cuz that used to work forever and I never told anyone else to ever change it.... 😮 either way I'm all good again! 😀

thx!

Steve

Wyatt...Ok...so that worked for a while and now getting code 15 error

see anything strange in the below....?other users are seeing it also and seems like they all have started a previous trial version from us are the only ones seeing a problem...

thx!---------------------

NSString *a = [[NSString alloc] initWithUTF8String: ProductVersionGUID]; HRESULT hr; hr = UseTrial(TA_SYSTEM); //Don't NOT change this back to GUID! DBGLog(@"-- Trial Error=%d", hr); if (hr != TA_OK) { [self errorMessage: @"Couldn't initialize BaseHead Trial Period!!" : @"Program stopped"]; [[NSApplication sharedApplication] terminate:self]; } // the user is not activated // check if trial period has expired unsigned int daysRemain = 0; hr = TrialDaysRemaining([a UTF8String], &daysRemain); // DBGLog(@"-- remain=%d", daysRemain); // daysRemain = 0; if (!((hr == TA_OK) && (daysRemain > 0))) [NSApp beginSheet:expiredSheet modalForWindow:mainWindow modalDelegate:mainWindow didEndSelector:nil contextInfo:nil]; else { .....

Well, again, TurboActivate.h tells you that 15 is 0xF, and 0xF means TA_E_PERMISSION:

/* MessageId: TA_E_PERMISSION


 MessageText:


 Insufficient system permission. Either start your process as an admin / elevated user or call the function again with the TA_USER flag instead of the TA_SYSTEM flag.*/#define TA_E_PERMISSION           ((HRESULT)0x0000000FL)

Does that make sense? So, if you want to use TA_SYSTEM then you need to use UseTrial() / CheckAndSavePKey() each at least once from an admin / elevated account. That's why we recommend calling those functions from, say, and installer (where admin permission is usually granted).

Yep...makes sense besides the fact that after 4+ years of using LimeLM for our demo mode it just started acting up now....heheWe do a Drag and Drop install now but I was planning on moving to a normal installer for the upcoming version 4.x anyway.until then I will set it to TA_USER for now

the main drawback for that is people can create a new user account to restart their trial period correct?not a huge deal cuz Pros will never do that cuz it's too much of a pain....8)

thx man!

Steve

the main drawback for that is people can create a new user account to restart their trial period correct?

Correct.

You say:

"Well, again, TurboActivate.h tells you that 15 is 0xF, and 0xF means TA_E_PERMISSION:"

I don't see where TurboActivate.h says that...

First, make sure you're using the latest version of TurboActivate. And using the latest integration files for TurboActivate (so, for C/C++ make sure you're using the latest TurboActivate.h file -- because we make improvements).

Then, after ensuring everything is up-to-date, look at the bottom of the TurboActivate.h file and you'll see a list of error codes. They're in hexadecimal, so if you have a decimal number and you want to manually look up an error code you first have to convert it to hexadecimal. Then, simply scroll down the list of error codes until you find the right one. Then read the error message and know what went wrong.