EP_TrialExpirationDate
EP_TrialExpirationDate function returns the trial expiration date. The trial expiration date should be defined on the TRIAL CONTROL - Limitation of expiration date panel. See also the extended function EP_TrialExpirationDateEx.
Parameters
- Year - the year of the trial expiration date.
- Month - the month of the trial expiration date.
- Day - the day of the trial expiration date.
Return Value
If the function succeeds, the return value is 1. If the function fails, the return value is 0.
Remark
The function fails in the following cases:
- the limitation of the expiration date was not enabled;
- the application is not protected.
If the user's PC has several user accounts, the trial information will be different for each user.
Definition
Show/Hide C++ function definition
extern "C" __declspec( dllimport ) __stdcall BOOL EP_TrialExpirationDate( int* Year, int* Month, int* Day );
Show/Hide Delphi function definition
function EP_TrialExpirationDate( var Year, Month, Day : integer) : boolean; stdcall;
Show/Hide Visual Basic function definition
Public Declare Function EP_TrialExpirationDate Lib "enigma_ide.dll" (ByRef Year As Long, ByRef Month As Long, ByRef Day As Long) As Byte
Show/Hide C# (.NET) function definition
public class Enigma_IDE
{
[DllImport("enigma_ide.dll", CallingConvention = CallingConvention.StdCall)]
public static extern bool EP_TrialExpirationDate(ref Int32 Year, ref Int32 Month, ref Int32 Day);
}
Examples
Show/Hide Delphi function example
uses
DateUtils,
Math,
enigma_ide;
procedure CheckTrial;
var
wYear : integer;
wMonth : integer;
wDay : integer;
begin
if EP_TrialExpirationDate(wYear, wMonth, wDay) then
begin
if not CompareDate(EncodeDate(wYear, wMonth, wDay), Now) = LessThanValue then
begin
MessageBox(0, 'Your trial period has expired! You must purchase application to take effect!', 'Application', 0);
ExitProcess(0);
end;
end else
MessageBox(0, 'I seem that you have forgotten to define date trial limit in Enigma!', 'Application', 0);
end;
See function examples in the installation folder, Examples\Trial subfolder.