| กก |
VLDCL contains a build-in registration protection module called RegisterShell, RegisterShell is designed to lock the VLDCL based application while distribution. There is a key to switch the enable/disable of RegisterShell: the 3rd argument of VLDCL function "VLDCL-MODULE". If the argument is set to 1, VLDCL will enable RegisterShell, or VLDCL will ignore RegisterShell.
The RegisterShell dialog is divided into three parts:
- Information part
There are totally 10 pre-defined text lines in this part. The access keys are "Line0" to "Line9". In this area, programmer can drop up to 10 lines (each line 50 letters in maximum) on introduction or information about the VLDCL based application.
- Register part
RegisterShell maintain three strings for checking:
- The given code
name pre-defined by programmer, you can use "Machine Code" or "Product Key" or any other names;
- The registered to user name
default is the login username of current computer in network.
- The Authorization key
you can define this as "Authorization Code" or any other strings.
- Operations part
There are four buttons in the Operations part:
- Register
If you have got the Authorization Key and fill the key in the dialog blank, press Register button will try to register. If the Authorization Key is OK, RegisterShell will never appear when calling the registered commands later.
- Trial
Before a certain Expired date, the Trial button will be accessible and can be the only way running the application. After the Expired date, the Trial button will be disabled.
- About
Display a message about RegisterShell for VLDCL.
- Quit
Just quit the program.
Please note that RegisterShell only support
"EXPIRATION DATE" lock. There are two ways
to define the expiration date, See detail below (VLDCL DXF1 of "Application") on how to set different expiration date:
- Real expired date
This means after a certain pre-defined date, the Trial mode will be closed.
- Relative expired date of 30, 60 and 90 days
This means the Trial mode will be closed at certain days after the first time calling the product.
Using
RegisterShell
RegisterShell for VLDCL does not support code checking, so the programmers need to define the function before calling RegisterShell. The function name is called:
C:REGISTER-CHECK.
(C:REGISTER-CHECK GivenCode UserName RegistrationCode)
Check if the registration code is correct. |
|
Argument 1: |
STRING |
The Given Code string. |
|
Argument 2: |
STRING |
The User Name string entered by user in dialog. |
|
Argument 3: |
STRING |
The Registration Code entered by user in dialog. |
|
Return: |
SUCCESS: |
T |
|
FAILURE: |
NIL |
If the C:REGISTER-CHECK function is not defined, VLDCL will always return NIL.
To call RegisterShell in proper way, the VLDCL-MODULE function need a global variable named as *DCL-REG* to be defined. RegisterShell same use VLDCL in dialog interface, so the following will be your guide to define *DCL-REG* variable.
If the *DCL-REG* was not pre-defined, VLDCL will automatically initialize the default *DCL-REG* and display RegisterShell dialog all by the default values. In generally, *DCL-REG* is very similiar with *DCL-DATA*. In fact, *DCL-REG* will be passed into *DCL-DATA* in vldcl-module function. The most different between the two variable is that *DCL-REG* need a particular label named as "Application" (case sensitive).
|
Application |
| VLDCL DXF 0: |
A string of the application name. |
| VLDCL DXF 1: |
An integer string of the expired date such as "20040630" or one of the three trial days flags: "::30" "::60" "::90". |
| Data Samples: |
'(("Application"(0 . "MyApp")(1 . "20040601")))
'(("Application"(0 . "MyApp")(1 . "::60"))) |
|
|
Line0, Line1, Line2...Line9 |
| VLDCL DXF 0: |
"text" |
| VLDCL DXF 1: |
The information string, up to 50 letters in one line. |
| Data Samples: |
'(("Line2"(0 . "text")(1 . "Welcome to KozMos
RegisterShell"))
("Line3"(0 . "text")(1 . "This is a sample in filling information"))
("Line4"(0 . "text")(1 . "in RegisterShell"))
) |
|
|
GivenCodeTXT,
UserNameTXT, RegCodeTXT |
| VLDCL DXF 0: |
"text" |
| VLDCL DXF 1: |
Fill the pre-defined code name string before the blank in dialog. |
| Data Samples: |
'(("GivenCodeTXT"(0 . "text")(1 . "Product Key:"))
("UserNameTXT"(0 . "text")(1 . "Register to:"))
("RegCodeTXT"(0 . "text")(1 . "Authorization Key:"))
) |
|
|
GivenCode, UserName, RegCode |
| VLDCL DXF 0: |
"text" |
| VLDCL DXF 1: |
User input code area. |
| Data Samples: |
'(("GivenCode"(0 .
"edit_box")(1 . "0000-0000-0000"))
("UserName"(0 . "edit_box")(1 . "*UnRegister*"))
("RegCode"(0 . "edit_box")(1 . "*UnRegister*"))
) |
The following is a typical *DCL-REG* variable
definition:
(setq *DCL-REG* '(("Application" (0 . "MyApp") (1 . "20040601"))
("GivenCodeTXT" (0 . "text") (1 . "Product Key:"))
("UserNameTXT" (0 . "text") (1 . "Register to:"))
("RegCodeTXT" (0 . "text") (1 . "Authorization Key:"))
("GivenCode" (0 . "edit_box") (1 . "0000-0000-0000"))
("UserName" (0 . "edit_box") (1 . "*UnRegister*"))
("RegCode" (0 . "edit_box") (1 . "*UnRegister*"))
)) |
By using VLDCL, the application structure will be very simple and clear. You can have two ways in calling VLDCL: normal freebies and registration lock. Following is the template codes for these two ways:
- RegisterShell for VLDCL active Template (Registration Lock)
(defun
c:vldcl-template (/ c:vldcl-done-ok c:vldcl-done-cancel c:vldcl-action-help
*DCL-OKCANCEL* *DCL-DATA* *DCL-REG* DCLFile Dialog)
(defun c:vldcl-done-ok() (princ "User Press OK button"))
(setq *DCL-OKCANCEL* '(("SubDialog1" (1 . "(if PressOKInSubDialog1 (PressOKInSubDialog1))"))
("SubDialog2" (1 . "(if PressOKInSubDialog2 (PressOKInSubDialog2))"))
)
*DCL-DATA* '(("help" (0 . "button") (1 . -1))
("Key1" (-1 . "SubDialog1")(0 . "edit_box")(1 . "10.0")(2
. ":REAL4"))
("*init*" (1 .
"(princ)"))
)
*DCL-REG*
//See above information//
DCLFile "Enter DCLFile name HERE!"
Dialog "Fill Start Dialog Name HERE!"
)
(vlisp-export-symbol '*DCL-DATA*)
(vldcl-module DCLFile Dialog 1)
(princ)
) |
- RegisterShell for VLDCL inactive Template (Freebie)
(defun
c:vldcl-template (/ c:vldcl-done-ok c:vldcl-done-cancel c:vldcl-action-help
*DCL-OKCANCEL* *DCL-DATA* DCLFile Dialog)
(defun c:vldcl-done-ok() (princ "User Press OK button"))
(setq *DCL-OKCANCEL* '(("SubDialog1" (1 . "(if PressOKInSubDialog1 (PressOKInSubDialog1))"))
("SubDialog2" (1 . "(if PressOKInSubDialog2 (PressOKInSubDialog2))"))
)
*DCL-DATA* '(("help" (0 . "button") (1 . -1))
("Key1" (-1 . "SubDialog1")(0 . "edit_box")(1 . "10.0")(2
. ":REAL4"))
("*init*" (1 .
"(princ)"))
)
DCLFile "Enter DCLFile name HERE!"
Dialog "Fill Start Dialog Name HERE!"
)
(vlisp-export-symbol '*DCL-DATA*)
(vldcl-module DCLFile Dialog 0)
(princ)
) |
Important notice on distribution of RegisterShell for VLDCL
- Please remember to set the three common used functions: c:vldcl-done-ok c:vldcl-done-cancel c:vldcl-action-help as local variables in your main application. Or you may got wrong function calling when compile complex or multiple Visual LISP files into one VLX file.
- Reset PC system time to former date will permanently lock all commands base on RegisterShell, so remember to mention the users while distributing applications based on RegisterSehll for VLDCL.
|