EP_TrialExecutions
函数用来取得试用运行的总次数和剩余次数。试运行的总次数需要在 试用控制 - 试用次数 面板中定义。或参看 EP_TrialExecutionsLeft 和 EP_TrialExecutionsTotal 函数。
参数
- Total - 限制程序运行的总次数。
- Left - 剩余的运行次数。
返回值
如果函数成功执行,返回值为 1 ,否则为 0 。
备注
在以下情况函数不会执行成功:
如果用户的计算机有多个登录用户,试用信息对每个用户均不同。
定义
Show/Hide C++ function definition
extern "C" __declspec( dllimport ) __stdcall BOOL EP_TrialExecutions( int* Total, int* Left );
Show/Hide Delphi function definition
function EP_TrialExecutions( var Total, Left : integer) : boolean; stdcall;
Show/Hide Visual Basic function definition
Public Declare Function EP_TrialExecutions 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_TrialExecutions(ref Int32 Total, ref Int32 Left);
}
实例
Show/Hide Delphi function example
uses
enigma_ide;
procedure CheckTrial;
var
TotalExecs : integer;
LeftExecs : integer;
begin
if EP_TrialExecutions(TotalExecs, LeftExecs) then
begin
if LeftExecs = 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 executions 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 TotalExecs;
int LeftExecs;
if (EP_TrialExecutions(&TotalExecs, &LeftExecs))
{
if (LeftExecs == 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 子文件夹查看函数实例。