EP_TrialDays
EP_TrialDays function servers for retrieving the total number of trial period days and thenumber of trial period days left. The total days count of the trial period should be defined in TRIAL CONTROL - Limitation of days count panel. See also the extended functions EP_TrialDaysLeft and EP_TrialDaysTotal.
Parameters
- Total - the total number of trial days.
- Left - the number of trial days left.
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 days count 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_TrialDays( int* Total, int* Left );
Show/Hide Delphi function definition
function EP_TrialDays( var Total, Left : integer) : boolean; stdcall;
Show/Hide Visual Basic function definition
Public Declare Function EP_TrialDays Lib "enigma_ide.dll" (ByRef Total As Long, ByRef Left 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_TrialDays(ref Int32 Total, ref Int32 Left);
}
Examples
Show/Hide Delphi function example
uses
enigma_ide;
procedure CheckTrial;
var
TotalDays : integer;
LeftDays : integer;
begin
if EP_TrialDays(TotalDays, LeftDays) then
begin
if LeftDays = 0 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 days trial limit in Enigma!', 'Application', 0);
end;
Show/Hide C++ function example
#include "include/enigma_api.h"
#pragma link "include/enigma_ide.lib"
void CheckTrial()
{
int TotalDays;
int LeftDays;
if (EP_TrialDays(&TotalDays, &LeftDays))
{
if (LeftDays == 0)
{
MessageBox(0, "Your trial period has expired! You must purchase application to take effect!", "Application", 0);
ExitProcess(0);
}
} else
{
MessageBox(0, "I seem that you have forgotten to define days trial limit in Enigma!", "Application", 0);
}
}
See function examples in the installation folder, Examples\Trial subfolder.