PP_GETVARCHAR()

Gets a character-type License File variable

Applies to:

Win32, Win64

Syntax-VB:

Declare Function pp_getvarchar(ByVal handle As Long, ByVal var_no As Long, ByVal buffer As String) As Long

Syntax-C:

LONG pp_getvarchar(PPLFHANDLE 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 retrieved

<buffer> is the location in which to place the variable data

Returns:

Refer to pp_errorstr() for a table of possible return codes and their meaning. Typically, PP_SUCCESS [1] is returned and the value of the variable is returned through the parameter <buffer>.

Description:

Use this function to obtain 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_getvarchar() is used to retrieve the character values one by one.

Note that <buffer> should first be initialized to a length of at least five characters longer than the length of the field being retrieved.

In Visual Basic, if the <buffer> is dimensioned at 55 characters and the data received is only 40 characters, there may be null or other characters after the valid data. We have found the easiest way to trim off these extra characters is to place the data into a hidden text box on a form and retrieve it back. The new value will be just the desired data.

 

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

Unused

CHAR[1]

22

 

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 user information from license file

' and store it in text boxes on a form

 

Dim result As Long

Dim buffer As String * 60 ' Make buffer big enough

result = pp_getvarchar(lfhandle, VAR_COMPANY, buffer)

Company.Text = buffer

result = pp_getvarchar(lfhandle, VAR_NAME, buffer)

UserName.Text = buffer

result = pp_getvarchar(lfhandle, VAR_ADDRESS1, buffer)

Address(0).Text = buffer

result = pp_getvarchar(lfhandle, VAR_ADDRESS2, buffer)

Address(1).Text = buffer

result = pp_getvarchar(lfhandle, VAR_ADDRESS3, buffer)

Address(2).Text = buffer

See Also:

PP_LFOPEN(), PP_SETVARCHAR(), PP_GETVARDATE(), and PP_GETVARNUM()

Concept Link IconRelated Topics