Migration to 4.0 API

Hi,

What are the high level steps we should do when migrating to the new 4.0 API?

Is there a blog/forum post that outlines those?

Thanks,MartinK

Hey Martin,

In C/C++ we have the migration notes right in the header file "TurboActivate.Deprecated.h":

/*TurboActivate 3.x Compatibility Notes======================================

The functions listed in this file (TurboActivate.Deprecated.h) are old functions from TurboActivate 3.x and older. Although they are deprecated,these old functions will still work with the TurboActivate 4.x library.

All of these function will be phased out in TurboActivate 5.x. Ifyou're building new apps, then don't use these functions at all. Justuse the functions in TurboActivate.h. That's where all the new features,improvements, and bug fixes are being done.

If you're maintaining an app that uses pre-TurboActivate 4.x functions,then here's how you upgrade from TurboActivate 3.x to TurboActivate 4.x and newer:

1. Every function call in the new TurboActivate API requires a handle

uint32_t taHandle = TA_GetHandle(_T("YOUR VERSION GUID HERE"));

2. Then pass that handle to the appropriate function found in TurboActivate.h For example here's calling the IsGenuineEx() funciton with the TurboActivate 3.x API:

HRESULT hr = IsGenuineEx(_T("YOUR VERSION GUID HERE"), &opts);

Here's calling TA_IsGenuineEx() with the TurboActivate 4.x API:

HRESULT hr = TA_IsGenuineEx(taHandle, &opts);

*/

For non-C/C++, it's even easier. Instead of using static methods like TurboActivate.IsActivated(), instead create the class first and then use instance methods. Like ta.IsActivated().

See the many example apps for the best examples.

Hey Wyatt,

What was the need for class instance compared to static calls?

Just wondering what is the overhead when instantiating the class in every stateless API call for example.

Thanks,Martin

You would only create a single class instance and "store it" in a global area and make calls in that instance. See our example apps, they show the best use case.

The reason for class instances vs static calls is for threat safety.