Protecting applications
Protecting applications
An application may be protected by moving one or more records from .app file to a DLL (dynamic link library) file.
The application file should contain the record
(:INCLUDE-DLL "name.dll")
The file name.dll should provide a function named VALIDATEAPP with two parameters and integer return value:
int VALIDATEAPP (const char *appname, char * buffer)
This function fills the buffer with lines to be included instead of :INCLUDE-DLL statement (maximal size 16K). It also can check the license or in other way check the user's rights. If the return code is negative, the buffer is not inserted and the loading of the application fails.
The validation function may fill the buffer with different contents depending on the results of validation.
If it includes the record (:LOG level "message text"), the message will be displayed in the log window. The level may be 0 (note), 1 (warning), 2 (error; fixed or may be ignored), 3 (error; not fixed), 4 (fatal error). The loading fails in case of errors of level 3 or higher.