EP_TrialDays
EP_TrialDays 用来取得试用期的总天数和剩余天数。试用期的总天数需要在 试用控制 - 试用天数 面板中定义。请参看 EP_TrialDaysLeft 和 EP_TrialDaysTotal 函数。
参数
- Total - 试用期总天数。
- Left - 试用期剩余天数。
返回值
如果函数成功执行,返回值为 1 ,否则为 0 。
备注
在以下情况函数不会执行成功:
如果用户的计算机有多个登录用户,试用信息对每个用户均不同。
定义
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);
}
实例
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);
}
}
可以在安装文件夹下的 Examples\Trial subfolder 查看函数实例。