PP_SETVARCHAR()
Sets a character type License File variable
Applies to:
Win32, Win64
Syntax-VB:
Declare Function pp_setvarchar(ByVal handle As Long, ByVal var_no As Long, ByVal buffer As String) As Long
Syntax-C:
LONG pp_setvarchar(LONG handle, LONG var_no, LPSTR buffer)
Arguments:
<handle> is the handle to the License File given by pp_lfopen()
<var_no> determines which variable is being changed
<buffer> is the value to which to set the License File variable
Returns:
Refer to pp_errorstr() for a table of possible return codes and their meaning. Typically, PP_SUCCESS [1] (variable was updated) is returned.
Description:
This function is used to set the character values of the variables stored in the License File. The function pp_lfopen() opens the License File and returns a handle. Then, pp_setvarchar() is used to set the character values one by one. The values are written to the License File automatically.
All character fields have a limit to the number of characters that they can store. If you plan to use this function to change the License File variables, you must make sure the length of the string you pass is not longer than the limit. Limited checking on the length is done by the library. If you fail to limit the characters, unpredictable results may occur.
Refer to the following table for a list of character fields and their appropriate sizes. The Expiration Type field is the only one stored in a License File contained in Crypto-Box Versa and Crypto-Box 560 Hardware Key.
|
NAME |
SIZE |
VAR# |
DEFINE |
|
Company name |
CHAR[50] |
1 |
VAR_COMPANY |
|
User name |
CHAR[50] |
2 |
VAR_NAME |
|
User address 1 |
CHAR[50] |
3 |
VAR_ADDRESS1 |
|
User address 2 |
CHAR[50] |
4 |
VAR_ADDRESS2 |
|
User address 3 |
CHAR[50] |
5 |
VAR_ADDRESS3 |
|
User phone 1 |
CHAR[20] |
6 |
VAR_PHONE1 |
|
User phone 2 |
CHAR[20] |
7 |
VAR_PHONE2 |
|
Product serial number (text) |
CHAR[20] |
8 |
VAR_SERIAL_TEXT |
|
Expiration type |
CHAR[1] |
9 |
VAR_EXPIRE_TYPE |
|
User-defined character field 1 |
CHAR[50] |
10 |
VAR_UDEF_CHAR_1 |
|
User-defined character field 2 |
CHAR[50] |
11 |
VAR_UDEF_CHAR_2 |
|
User-defined character field 3 |
CHAR[50] |
12 |
VAR_UDEF_CHAR_3 |
|
User-defined character field 4 |
CHAR[50] |
13 |
VAR_UDEF_CHAR_4 |
|
User-defined character field 5 |
CHAR[50] |
14 |
VAR_UDEF_CHAR_5 |
|
User-defined character field 6 |
CHAR[50] |
15 |
VAR_UDEF_CHAR_6 |
|
User-defined character field 7 |
CHAR[50] |
16 |
VAR_UDEF_CHAR_7 |
|
User-defined character field 8 |
CHAR[50] |
17 |
VAR_UDEF_CHAR_8 |
|
User-defined character field 9 |
CHAR[50] |
18 |
VAR_UDEF_CHAR_9 |
|
User-defined character field 10 |
CHAR[50] |
19 |
VAR_UDEF_CHAR_10 |
|
Hardware binding drive param |
CHAR[1] |
20 |
VAR_EZTRIAL_COMPNO_DRIVE |
|
Alias name - system directory |
CHAR[14] |
21 |
VAR_EZTRIAL_SYSDIR_FILENAME |
|
EZ Trigger binding drive param |
CHAR[1] |
22 |
VAR_EZTRIG_COMPNO_DRIVE |
|
Alias name - registry key 1 |
CHAR[60] |
23 |
VAR_EZTRIAL_REG_ALIAS1 |
|
Alias name - registry key 2 |
CHAR[60] |
24 |
VAR_EZTRIAL_REG_ALIAS2 |
|
EZ Trigger dialog labels |
CHAR[50] |
25 |
VAR_EZTRIG_DLG_LABELS |
|
AutoCL Proxy Server |
CHAR[49] |
26 |
VAR_AUTOCL_PROXY_ADDR |
|
AutoCL Visit URL |
CHAR[79] |
27 |
VAR_AUTOCL_URL_VISIT |
|
AutoCL BuyNow URL |
CHAR[99] |
28 |
VAR_AUTOCL_URL_BUYNOW |
|
AutoCL Unlock URL |
CHAR[79] |
29 |
VAR_AUTOCL_URL_UNLOCK |
|
AutoCL Register URL |
CHAR[79] |
30 |
VAR_AUTOCL_URL_REGISTER |
|
EZ Trial binding file param |
CHAR[127] |
31 |
VAR_EZTRIAL_COMPNO_FILE |
|
Unused |
|
32 |
|
|
AutoCL License Password |
CHAR[20] |
33 |
VAR_LICENSEPW |
|
Installation ID |
CHAR[35] |
34 |
VAR_INSTALLATIONID |
|
License Key |
CHAR[40] |
35 |
VAR_LICENSEKEY |
Example:
' Get some of the user information from the user and store
' it in the License File. lfhandle contains the License
' File handle which was initialized earlier.
Dim rc As Long
rc = pp_setvarchar(lfhandle, VAR_COMPANY, Company.Text)
rc = pp_setvarchar(lfhandle, VAR_NAME, UserName.Text)
rc = pp_setvarchar(lfhandle, VAR_ADDRESS1,Address(0).Text)
rc = pp_setvarchar(lfhandle, VAR_ADDRESS2,Address(1).Text)
rc = pp_setvarchar(lfhandle, VAR_ADDRESS3,Address(2).Text)
See Also:
PP_LFOPEN(), PP_SETVARDATE(), PP_SETVARNUM(), and PP_GETVARCHAR()