Errors when activating with example

Hello all,I am still very new to C programming, and I have things mostly working using the example provided with TurboActivate. My one issue is, when I try to run the .exe that Visual Studio compiles, it looks like this: http://screencast.com/t/KQnF3e9bLW9My code seems to be all fine and good, and the license is enabled and I can activate on hypervisor (my computer is hypervisor)

My code is as here: http://paste.teambuildirc.com/view/c3191c20 I host my own pasting site, and that's why it's not a normal paste URL. I can post in a code bracket on here if BB code is supported, but it seems that it isn't.. And I have all the .dll files, and the .dat file inside of my main application folder

Any help is appreciated!

P.S. I have tried to activate the same license number that I'm using in the code in one of the pre-done applications included with the source, and it activated perfectly fine.

The TurboActivate.h file tells you what all the errors are and what they mean. In the screenshot you see the error code 8, which is hex 0x8. Find that in TurboActivate.h:

/* MessageId: TA_E_PDETS


 MessageText:


 The product details file "TurboActivate.dat" failed to load.*/#define TA_E_PDETS                ((HRESULT)0x00000008L)

In other words your app can't find the TurboActivate.dat file, or the file is corrupt. Make sure the TurboActivate.dat file is in the same folders as the TurboActivat.dll file. Try using PDetsFromPath() to tell TurboActivate where the *.dat file is explicitly.

That does seem to be the issue, Visual Studio isn't including the *.dat file when it compiles, so it isn't in the folder when it tries to run.Now, when i try to use the PDetsFromPath function, it isn't happy.. I have tried any number of this PDetsFromPath("C:\Users\Patrick\Design\Teams\Phoenix\ACL Applications\for windows\turboactivate-static\TurboActivate.dat");and it doesn't seem to work, My guess is I'm using it wrong. Is there a documentation page on it somewhere?

I have tried any number of this PDetsFromPath("C:\Users\Patrick\Design\Teams\Phoenix\ACL Applications\for windows\turboactivate-static\TurboActivate.dat");

There are a number of mistakes there. See any article explaining character ecaping in C/C++ strings. In particular, the backslash has to be "escaped".

So, instead of this:

"C:\Path\To your\Location\ta.dat"

You use this:

"C:\\Path\\To your\\Location\\ta.dat"

Notice the double slashes. The slash is the "escape" character in C/C++, and thus to get a slash you have to use 2 slashes.

Also, you need to use Unicode strings in Windows. So this is wrong:

PDetsFromPath("C:\Users\Patrick\Design\Teams\Phoenix\ACL Applications\for windows\turboactivate-static\TurboActivate.dat");

This is the right way:

PDetsFromPath(L"C:\\Users\\Patrick\\Design\\Teams\\Phoenix\\ACL Applications\\for windows\\turboactivate-static\\TurboActivate.dat");

Notice the "L" before the opening quote of the string. That marks the string as a UTF16 string for the compiler.

Hmmm.. Still can't get it to work, it's saying that the PDetsFromPath isn't valid.. Probably because I don't know much C and I'm using it wrong. It's late though, hopefully I will be able to learn some more C and see where I'm going wrong 🙂 thanks for the help so far!

Hmmm.. Still can't get it to work, it's saying that the PDetsFromPath isn't valid..

What's saying that? Your compiler? Give me the full error.

Here is the errors:Error 1 error C2143: syntax error : missing ')' before 'string' Error 2 error C2143: syntax error : missing '{' before 'string' Error 3 error C2059: syntax error : '<Unknown>' Error 4 error C2059: syntax error : ')' 5 IntelliSense: this declaration has no storage class or type specifier

And here is the entire line that I'm using to define the PDetsFromPath// Define the hard coded location of the *.dat filePDetsFromPath(L"C:\\Users\\Patrick\\Design\\Teams\\Phoenix\\ACL Applications\\for windows\\turboactivate-static\\TurboActivate.dat");

Not the intellisense errors -- the compiler errors. Build your app. Give me the first compiler error.

I've shut down my computer for the night, but I will get those for you in the morning. Again, thanks for all the help so far!

Whenever I build, this is all the output..

1>------ Build started: Project: Example, Configuration: Debug Win32 ------1> Example.c1>c:\users\patrick\design\teams\phoenix\acl applications\for windows\turboactivate-static\example.c(38): error C2143: syntax error : missing ')' before 'string'1>c:\users\patrick\design\teams\phoenix\acl applications\for windows\turboactivate-static\example.c(38): error C2143: syntax error : missing '{' before 'string'1>c:\users\patrick\design\teams\phoenix\acl applications\for windows\turboactivate-static\example.c(38): error C2059: syntax error : '<Unknown>'1>c:\users\patrick\design\teams\phoenix\acl applications\for windows\turboactivate-static\example.c(38): error C2059: syntax error : ')'========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Show me line 38 and include several lines before and after. It's probably a missing semicolon.

The PDetsFromPath() function has to be inside the "main()" function. You can't just call functions out in the middle of nowhere.

Ok, while on my search to figure out how to read from a licensing file (we want to distribute a file with the license in it, and then read from that file..), it seems that CheckAndSavePKey() doesn't like it when I pass a string into it.. Is it possible to do?hr = CheckAndSavePKey(_T("%s", line), TA_USER);^^ This is my code, and if i docout << lineThen it works perfectly fine and reads the contents of the file, so i know that the `line` string is fine, it just isn't being read by the function.I'm slowly learning more and more C 🙂 Starting to work.. Hoping to fix the PDetsFromPath(); later tonight, haven't been focusing on it yet.. Been working on the license function

EDIT: Just thought I would let you know, I got the PDetsFromPath() working! Thanks for the help on that!