Determines number of days before expiration
Declare Function pp_daysleft(ByVal handle As Long, ByRef daysleft As Long) As Long
LONG pp_daysleft(LONG handle, LPLONG daysleft)
<handle> is the handle to the License File given by pp_lfopen()
<daysleft> is the location to place the number of days left
Refer to pp_errorstr() for a table of possible return codes and their meaning. Typically, PP_SUCCESS  (ID was retrieved) is returned.
This function performs one of two tests, depending on the value of the product expiration type stored in the License File. If the expiration type is "N" or "E", the number of days left does not apply. In this case, ERR_EXPTYPE_INVALID is returned.
There are two expiration dates available in the License File - a soft expiration and a hard expiration. You cannot use a soft expiration date without a hard expiration date. The number of days between the current date and the soft and hard expiration dates are calculated. The lesser of these two values is returned in the <daysleft> parameter passed by reference.
Note that if you only have one expiration date, you should always use the HARD expiration date and leave the SOFT expiration date 0/0/0.
If an application has expired (by date), it is important to perform a pp_upddate(). This is so that the combination of date checking and expiration date checking prohibits unauthorized use of your application. This avoids a client attempting to back up the system date of a computer allowing the client to back into the application. If the application calls pp_upddate() and a client attempts to back up a system date before the expiration date, the program will fail the pp_valdate() check.
Dim str As String, daysleft As Long
If pp_expired(lfhandle) Then
str = "Sorry, the demo for this product has expired!"
str = str + " Please call and order from Concept"
str = str + "Software at (407) 786-4457"
MsgBox str, 0, "Application Error"
' Update the last used date & time so the user won’t be
' able to set the system date back
pp_upddate lfhandle, 0
' get the number of days left
pp_daysleft lfhandle, daysleft
MsgBox "You have " & daysleft & "to evaluate this product"
PP_EXPIRED() and PP_UPDDATE()