CheckAndSavePKey(keyStr, TA_SYSTEM); and CheckAndSavePKey(keyStr, TA_USER); all returned 1
void ASAPI License::licenseActivate(ac_itemRef item, ac_notifierRef notifier){ if (isTurboActivateChecked == false) return; USES_CONVERSION;
ac_int32 length; char data[LICENSING_MESS_SIZE]; //long answer = 0; std::string aKeyStr; LPWSTR keyStr; HRESULT hr; ac_itemRef info = sACDialog->GetItem(g->licenseDlg, kLicenseMessText); ac_itemRef xfer = sACDialog->GetItem(g->licenseDlg, kExportLicenseButton); ac_itemRef buy = sACDialog->GetItem(g->licenseDlg, kLicensePurchaseButton); ac_itemRef key = sACDialog->GetItem(g->licenseDlg, kActivateKeyItem); sACMenuItem->SetText(xfer, "Transfer"); sACMenuItem->SetTipString(xfer, LICENSING_TRANSFER_TIP);
length = sACMenuItem->GetTextLength(key); sACMenuItem->GetText(key, data, length); aKeyStr.assign(data, length); if (length == LICENSE_ACTIVATION_KEY_LENGTH && aKeyStr.find ("-" , 1) != string::npos ) { keyStr = A2W(aKeyStr.c_str());
hr = CheckAndSavePKey(keyStr, TA_SYSTEM); //got 1A if (hr == TA_OK) {//licenseValidated ip_license_support = License::checkAndActivateKey(true); } else { acErrorAlert("License: Failed TA_SYSTEM code "+ Gcodes::tostr(hr, 0) + ", checking TA_USER..."); hr = CheckAndSavePKey(keyStr, TA_USER); if (hr == TA_OK) {//licenseValidated ip_license_support = License::checkAndActivateKey(true); } else { acErrorAlert("License: Failed TA_USER code " + Gcodes::tostr(hr, 0) + ", aborting..."); ip_license_support = ip_none; } } } else {//maybe reactivation? ip_license_support = License::checkAndActivateKey(true); } if (ip_license_support != ip_none) { sACMenuItem->SetText(key, aKeyStr.c_str()); sACMenuItem->SetText(buy, "Visit Us"); sACMenuItem->Enable(xfer, true); sACMenuItem->Enable(item, false); } LicensePrintSupportText(ip_license_support, ip_license_support != ip_none);}