manual activation on Linux

I am trying to build a test program to do a manual activation under Linux. The call to ActivationRequestToFile() is failing. Here is my test program:

#include <stdio.h>#include <stdlib.h>#include "TurboActivate.h"

int main(const int argc, const char **argv){ HRESULT hr;

hr = PDetsFromPath("/tmp/TurboActivate.dat"); if (hr != TA_OK) { printf("Could not load TurboActivate.dat\n"); } else { printf("Loaded TurboActivate.dat\n"); }

hr = IsActivated("6880351224d79382df3a3a4.70769226");

if (hr != TA_OK) { printf("You are not activated\n"); } else { printf("You are activated\n"); }

hr = ActivationRequestToFile("/tmp/activate.xml");

if (hr != TA_OK) { printf("Could not generate an activation request.\n"); } else { printf("Generated an activation request.\n"); }}

I compile this with ...

g++ -L. -lTurboActivate -Wl,-rpath,`pwd` main.c

And I get:

$ ./a.out Loaded TurboActivate.datYou are not activatedCould not generate an activation request.

What am I missing?

Thanks!

You never saved a product key. So, use CheckAndSavePKey("ABCDE-FGHI-...etc") before you call "ActivationRequestToFile()". The reason is that the activation request file contains (among other things) the product key. If you never set a product key, the activation request file cannot be generated.

Also, the return code (hr) will give you a clue as to the failure. For instance, if you call ActivationRequestToFile() without having previously set a product key using CheckAndSavePKey(), then the "hr" value will be TA_E_PKEY.

Does this make sense?