Open topic with navigation
Get Trigger Code Data from SOLO server
Declare Function SK_GetTCData(ByVal server As String, ByVal proxy As String, ByVal url As String, ByVal licenseid As Long, ByVal pw As String, ByVal cenum As Long, ByVal compno As Long, ByRef result1 As Long, ByRef result2 As Long, ByVal licenseupd As String) As Long
LONG SK_GetTCData(LPSTR server, LPSTR proxy, LPSTR url, LONG licenseid, LPSTR pw, LONG cenum, LONG compno, LPLONG result1, LPLONG result2, LPSTR licenseupd)
<server> is the name or IP address of the SOLO server (do not use prefix of "http://"). For Instant SOLO, use "swk".
<proxy> is the name or IP address and port of any proxy server necessary to access the Internet. The format is server:port. Eg) proxy.consoft.com:80.
<url> is the document path and name to use (must start with "/"). For Instant SOLO, use "/solo/unlock/getcode.asp".
<licenseid> is the LicenseID of the user
<pw> is the Customer Password of the user
<cenum> is the Code Entry number
<compno> is the Computer ID number
<result1> is the Trigger Code Event ID from the SOLO server
<result2> is the Trigger Code Event Data from the SOLO server
<licenseupd> is any LicenseUpdate value from the SOLO server, or 0 to ignore this parameter
In addition to the possible return values described in SK_GetErrorStr(), the SOLO server may respond with the value of 100 or greater. The value of 100 means that the data was received properly but that the data entered by the user was not found in the license database. You can display a specific message to this effect when you receive this error code. The HTML necessary to return a specific error code is Error Response = 100 (space equals space then data).
The value of RegKey1 and RegKey2 and License Update fields will be returned via resul1 and result2 parameters. You must decode these values with the pp_tcode() function.
HTML Return Strings:
Registration code1 = (space equals space then data)
Registration code2 =
License Update =
No More Keys available! (to cause a return code of 7)
This function is used to retrieve the Trigger Code
from a remote SOLO server. This would be performing the exact same function
as the user calling you on the telephone to get their Trigger Code Event
ID and optional Event Data. The input to the SOLO server is the License
ID, Customer Password, PLUS Code Entry Number and PLUS Computer ID number.
The SOLO server validates and logs the Trigger Code request and provides
the proper values through the result1 and result2 parameters. If there
is a License Update string, this will also be returned through <licenseupd>.
NOTE: This function is merely a transport mechanism to receive the Trigger Code data that the user would have typed into the phone Trigger Code dialog box. You must still decode and process the value as you would if the user typed in RegKey1 and RegKey2. If you are using EZ Trigger, consider using the function SK_ProcEZTrig1() as it displays the dialog box and processes the Trigger Code with no additional coding.
Dim result As Long, code1 As Long, code2 As Long
Dim result1 As Long, result2 As Long
Dim errorbuffer As String * 50
' generate our user code values normally displayed on
' the Trigger Code dialog box
code1 = pp_cenum
code2 = pp_compno( COMPNO_WINPRODID, "", "" )
' the user entered their LicenseID and LicensePW
' on the dialog box and we use those values below
' Get the trigger code from the web
result = SK_GetTCData("swk", "", "/solo/unlock/getcode.asp", Val(LicenseID.Text), LicensePW.Text, code1, code2, result1, result2, 0)
If result = 100 Then
MsgBox "LicenseID and/or Password invalid!", vbOKOnly, "Registration Error"
ElseIf result < 100 And result <> 0 Then
' get the error code
SK_GetErrorStr result, errorbuffer
MsgBox "Error = " & errorbuffer, vbOKOnly, "Registration Error"
' See if a valid code was entered
result = pp_tcode(result1, code1, code2, 400)
' The SOLO server gave us the values for regkey1
' and regkey2 that the user would have gotten over the
' phone. Now we must decode the trigger code received.
CheckTriggerCode result, result2