jlatham

Registration DLL

The help file is sorely lacking on this subject.

I altered the Verification function to always return success (just to see if I could make the thing work), but that doesn't seem to make a difference, I always get an indication that my serial number isn't valid. What gives? How do I debug this?
Guest

I changed it so that all my registration DLL does is:

Code: Select all

FILE* fout = fopen("C:\myfile.txt","w");
fprintf(fout, "You don't even execute this, do you?");
fclose(fout);
And sure enough, the installer isn't even executing my function... I'm sure that I'm picking the correct DLL, and this is the only function that I export.

What does the <###-%%%> mean for template? Does this mean that I need to put certain numbers in for the key to be valid?
UdreaMihai
Posts: 90
Joined: Wed Mar 23, 2005 8:13 am

Hi,

Did you try our tutorial?
http://www.advancedinstaller.com/user-g ... n-dll.html

It includes a serial validation DLL project and an Advanced Installer project file using the DLL. You should find there the answer at your questions.

The template it is used to specify the format of the serial number. The "<###-%%%>" sets a format of 2 groups of 3 digits each.

Best,
Mihai.
Udrea Mihai
Advanced Installer Team
http://www.advancedinstaller.com
Guest

There really isn't that much to the tutorial. The problem was that using <###-%%%> doesn't work, but switching it to <%%%-%%%> does make it call into the DLL. That's weird.

Now I have a problem with the DLL itself where something happens and I get an error saying the installer prematurely ended. But I can't seem to figure out why. Is there any way to set breakpoints in my registration DLL?
UdreaMihai
Posts: 90
Joined: Wed Mar 23, 2005 8:13 am

Hi,

You can create a log file. After every operation that your program performs write a message into a file and save it.

Now you can see what is the point where your program stops.

If you want to really debug your DLL take a look at:
http://msdn.microsoft.com/library/defau ... ctions.asp


Best regards,
Mihai.
Udrea Mihai
Advanced Installer Team
http://www.advancedinstaller.com
Guest

Does it matter if you're using an MFC extension DLL or a regular Win32 DLL? If you want to use MFC, should you link it statically or dynamically? Does that matter?
jlatham

Got that part

I wasn't quite able to figure out exactly what was wrong with my DLL. But I found that if I put some more error checks in there, I was catching some exceptions. Dealing with them properly seems to have fixed my issue. Why the exceptions are caused, I don't know, but it works, so I don't care. :D

Return to “Common Problems”