Integrating TurboActivate into a mac app

I have a mac application bundle (*.app) that is written in Python (it is using the QT framework). How would I go about in integrating TurboActivate into this application?

As a side note, I also have the same application which runs on windows and I am able to integrate TurboActivate into an NSIS installer. I was wondering if there was a similar mac alternative.

That's a good question. The way to use TurboActivate from a Python app is to use the ctypes "foreign function library" to call the appropriate TurboActivate functions. You can open the TurboActivate.h file to see the function definitions. Then just use the ctypes python library to call the libTurboActivate.dylib functions from your app.

Tell me if that helps.

That's a good question. The way to use TurboActivate from a Python app is to use the ctypes "foreign function library" to call the appropriate TurboActivate functions. You can open the TurboActivate.h file to see the function definitions. Then just use the ctypes python library to call the libTurboActivate.dylib functions from your app.

Tell me if that helps.

That definitely sounds good to me. I'll try it out asap. 😀

Is this the correct way of doing it?

Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32Type "help", "copyright", "credits" or "license" for more information.>>> from ctypes import *>>> turboActivate = CDLL('TurboActivate.dll')>>> turboActivate.IsActivated('1500469943509444340afa16.23515477')7>>>

Note that I decided to try it on windows first so that I can reuse the code for mac.

You can see all the error codes in TurboActivate.h. So a return code of 7 is TA_E_GUID, which means:

The version GUID doesn't match that of the product details file.

Now I'm guessing you copied and pasted the GUID directly from your LimeLM version. So if the GUID is correct, then what could be the problem? (That is, why would TurboActivate not see the correct GUID when you're clearly passing the correct GUID in).

My guess is that in your arglist for the IsActivated() function you're using a "char *" string type. However, on Windows (and only Windows) the string type is a "wide string" (LPCWSTR).

Tell me if that helps.

That was it. Good debugging.

I used the create_unicode_buffer ctypes function that returns a wide string.

After trying it on mac, I get a return code of 8 which states that "The product details file "TurboActivate.dat" failed to load."

Any ideas as to why this could be the case? I have the .dat file in the same directory as the .dylib file.

If TurboActivate can't find where you're putting the TurboActivate.dat file then you'll have to use the PDetsFromPath() function to specify where the *.dat file is before you call any other TurboActivate function.

Worked like a charm. Thanks.