Cannot set GUID (bad suffix on number)

I'm trying to implement TurboActivate in my C++ project and I'm getting syntax errors when I try to set my GUID.

HRESULT hr = IsGenuineEx(###############.########, &opts);

I copy and pasted the GUID as the first argument, but I get 3 syntax errors:

C2059: syntax error : 'bad suffix on number'C2146: syntax error : missing ')' before identifier '###################'C2660: 'IsGenuineEx' : function does not take 1 arguments

(Obviously ############# is my GUID)

Am I doing this right?

It's a string, so it should be in quotes. And on Windows it needs to be a Unicode string. See the Example.c file for a full C/C++ example.

Here's the correct line:

HRESULT hr = IsGenuineEx(L"###############.########", &opts);

(Notice the quotes and the "L" literal before the opening quote).

Ah that did it! I tried with quotes, but never thought to add the L. It's working now, but one more question.

I've been testing it all out, but when I went to my dashboard and deactivated the product key I used, TurboActivate still says it's activated. Does it take time to update or something?

Here is my code:

int main(int argc, char *argv[]){ QApplication a(argc, argv); MainWindow w;

GENUINE_OPTIONS opts; opts.nLength = sizeof(GENUINE_OPTIONS); opts.nDaysBetweenChecks = 30; opts.nGraceDaysOnInetErr = 1;

opts.flags = TA_SKIP_OFFLINE;

HRESULT hr = IsGenuineEx(L"######################", &opts);

if (hr == TA_OK || hr == TA_E_FEATURES_CHANGED || hr == TA_E_INET || hr == TA_E_INET_DELAYED) { // your app is activated and genuine

w.show(); return a.exec();

if (hr == TA_E_INET || hr == TA_E_INET_DELAYED) { // TODO: show a warning to your user that this time (or recently) // the IsGenuineEx() failed to connect to the LimeLM servers. }

return a.exec(); } else { QProcess a2; a2.start("TurboActivate.exe"); a2.waitForFinished(-1); a2.close(); // TODO: Not genuine or not activated. Either way you should either // restrict the user from using your app or give the user a trial // of your app. }}

I just caught the second return a.exec(), I removed it now.

Nevermind, I believe I answered my own question. It takes the nDaysBetweenChecks for it to check the current license status.

It takes the nDaysBetweenChecks for it to check the current license status.

Correct.