I keep getting " The version GUID doesn't match that of the product details file." flag

I am just starting to integrate LimeLM into my app so I am probably missing something basic. The code is in C under Windows. I have this code:

HRESULT hr; const char* guid = "6b8cd29254c2a9a8e3c6a6.74774921"; hr = IsActivated((STRCTYPE)guid); printf("activation return code: %d\n", hr);

I keep getting a return flag 7 here (The version GUID...).If I use IsGenuineEx() function instead I get the same return code.

I made a sample product and put .dat file in the same directory as my program. I didn't call any other functions from LimeLM API. It seems to me that I should get not activated return code instead of the one I am getting though. Any ideas what is going on ?

const char* guid = "6b8cd29254c2a9a8e3c6a6.74774921";

hr = IsActivated((STRCTYPE)guid);

That's the problem right there. A general rule of thumb regarding string types: never "cast" the string value to make it compile. Yes, it will compile, but it will also fail to function properly (as you've seen).

Look at the example C application and you'll see that a TCHAR * string is used for every TurboActivate function. That's because on Windows TurboActivate requires a "wchar_t" type of string (double-byte character Unicode strings), while on Linux / Mac / Unix TurboActivate requires a "char" type of string (single-byte character UTF-8 string).

Does that make sense?

I casted to remove the warning as I've seen in the turboactivate.h that STRCTYPE should be #define to const char*Maybe I've misread the #ifdef tree. After substituting const char* guid with wchar_t* or TCHAR* the result is still the same.

Could you point me to that sample C program ? What I've found here: http://wyday.com/limelm/help/using-turboactivate-with-c-plus-plus/ just uses ProductVersionGUID without defining it anywhere.

I suspect that maybe the reason is that I am using GCC 4.8 with MinGW and I have noticed a snarky comment towards in in the .h file. Unfortunately GCC is the only standard compliant C compiler available for Windows so I don't have an option to check if the code would work under Visual Studio (as it doesn't compile C after C89 version).It would be very helpful to me if I knew what all the #defines for types should resolve to so I could fix the #IFDEF tree to work with gcc.

Could you point me to that sample C program ? What I've found here: http://wyday.com/limelm/help/using-turboactivate-with-c-plus-plus/ just uses ProductVersionGUID without defining it anywhere.

It's in the TurboActivate Package on your API page. It's the "Example.c" file in the "API\C" folder.

After substituting const char* guid with wchar_t* or TCHAR* the result is still the same.

Well, if you don't have "Unicode" enabled for your compiler (i'm not sure how MingW implements it) then TCHAR* will become "char*" which is exactly what you don't want.

All strings in the Windows version of TurboActivate are wchar_t*. Don't use casting at all:

const wchar_t* guid = L"6b8cd29254c2a9a8e3c6a6.74774921";


hr = IsActivated(guid);

Also notice the "L" literal before the opening quote of the string. Read more about that here.

I didn't know about the L thing with wide string literals. I've now got TA_FAIL return code which is what is supposed to happen. Thank you for your help 🙂

Great, I'm glad to help.

So I have one more problem: call to Activate() causes an application crash.I was able to call CheckAndSavePKey successfully but call to Activate() failed (and crashed). I have run the TurboActivate wizard after that and it succeeded in activating the app (without me reentering the key, so I guess CheckAndSavePKey from before was succesful). It would be more convenient to me to call Activate myself without using the wizard. I don't know how to provide more useful feedback about the crash but maybe someone encountered this problem before and there are some things I could check for. Any ideas ?

So I have one more problem: call to Activate() causes an application crash.

That's odd, are you sure it's TurboActivate that's crashing? Can you send a crash dump to wyatt@wyday.com. Also, try running your app in a debugger and step through 1 line at a time.

Lastly, make sure your app is calling the functions as CDECL functions not STDCALL functions (unless, of course, you're using the STDCALL version of TurboActivate). MingW may or may not handle the standard Windows definitions in the TurboActivate.h file (which is among 1 of the many reasons we tell customers to avoid MingW and instead use the freely available Microsoft compilers on Windows).

Using the wrong calling convention is the only thing I can think of that would cause TurboActivate to crash (or really, cause your app to crash).

Thank you for your help, the tips were very helpful. The only thing I've changed was adding TURBOACTIVATE_API prefix to Activate() function and it worked.I can now easily deactivate and activate from inside my app.

>>which is among 1 of the many reasons we tell customers to avoid MingW and instead use the freely available Microsoft compilers on Windows

I realize that MSVSC was traditionally the best compiler was Windows but these days there are a lot of incentives to use MINGW. It's standard compliant (MSVSC only support C89 and C99 and C11 standards brought many useful features) also it produces way faster code (it's 30%-40% difference in execution speed in my case). For uses like mine where execution speed is the main reason people are interested in my app instead of the ones of the competition using Microsoft compiler isn't really an option.

Anyway, it seems like everything works just fine now. Thank you for your help and patience 🙂