ervkosch
04-29-04, 07:07 PM
Here the instructions for writing the DLL:
You can write your own DLL to validate the serial number entered by the user during Setup. However you must follow a specific format when writing the validaton routines.
es-Wiz supports two types of valdiation - Basic and Advanced. In both cases, the DLL receives the the user's name, company name and serial number (all in LPSTR or PCHAR type) and returns a value to indicate whether the validation is successful.
Basic Validation
However the former allows the DLL to only return a UINT value. Setup will proceed if the return value is TRUE. The user, if is unable to provide a good serial number, will not be able to install the software but the files will still be accessible by means of a third party archiving software (e.g. WinZ_p or WinRa_).
The format of the function must either be as follows:
· UINT your_validation(hwnd HWnd; LPSTR user_name, user_company, serial_number);
· function your_validation(hwnd: THANDLE; user_name, user_company, serial_number: PCHAR): UINT; stdcall;
where hwnd is the handle of the Wizard Dialog, user_name is the entered user name; user_company is the company name and serial_number is the serial number entered. Name of function (in green) can be anything but must be clearly mentioned in the "Validation Option" box. All fields are passed to the DLL as if they were entered (No trailing spaces trimmed..etc)
Note: When writing your DLL in Borland Delphi you should use the stdcall calling convention.
Here's what I've been able to come up:
#include <windows.h>
#include <stdio.h>
UINT __stdcall __export CheckID(HINSTANCE hinstDLL ,
PCHAR user_name,
PCHAR user_company,
PCHAR serial_number) {
return TRUE;
}
Any idea on what I'm doing wrong?
You can write your own DLL to validate the serial number entered by the user during Setup. However you must follow a specific format when writing the validaton routines.
es-Wiz supports two types of valdiation - Basic and Advanced. In both cases, the DLL receives the the user's name, company name and serial number (all in LPSTR or PCHAR type) and returns a value to indicate whether the validation is successful.
Basic Validation
However the former allows the DLL to only return a UINT value. Setup will proceed if the return value is TRUE. The user, if is unable to provide a good serial number, will not be able to install the software but the files will still be accessible by means of a third party archiving software (e.g. WinZ_p or WinRa_).
The format of the function must either be as follows:
· UINT your_validation(hwnd HWnd; LPSTR user_name, user_company, serial_number);
· function your_validation(hwnd: THANDLE; user_name, user_company, serial_number: PCHAR): UINT; stdcall;
where hwnd is the handle of the Wizard Dialog, user_name is the entered user name; user_company is the company name and serial_number is the serial number entered. Name of function (in green) can be anything but must be clearly mentioned in the "Validation Option" box. All fields are passed to the DLL as if they were entered (No trailing spaces trimmed..etc)
Note: When writing your DLL in Borland Delphi you should use the stdcall calling convention.
Here's what I've been able to come up:
#include <windows.h>
#include <stdio.h>
UINT __stdcall __export CheckID(HINSTANCE hinstDLL ,
PCHAR user_name,
PCHAR user_company,
PCHAR serial_number) {
return TRUE;
}
Any idea on what I'm doing wrong?