EP_CheckupCopies
EP_CheckupCopies function returns the total and current number of executed copies of the protected file. The initial settings should be entered in the CHECK-UP - Executed Copies panel. Also, see the extended functions EP_CheckupCopiesCurrent and EP_CheckupCopiesTotal.
Parameters
- Total - the total number of executed copies allowed.
- Current - the current number of executed copies.
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:
- checkup of executed copies is not enabled;
- the application is not protected.
Definition
Show/Hide C++ function definition
extern "C" __declspec( dllimport ) __stdcall BOOL EP_CheckupCopies( int* Total, int* Current);
Show/Hide Delphi function definition
function EP_CheckupCopies( var Total, Current : Cardinal) : boolean; stdcall;
Show/Hide Visual Basic function definition
Public Declare Function EP_CheckupCopies Lib "enigma_ide.dll" (ByRef Total As Long, ByRef Current 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_CheckupCopies(ref Int32 Total, ref Int32 Current);
}
Examples
Show/Hide Delphi function example
uses
enigma_ide;
procedure CheckCopies;
var
Total, Current : Cardinal;
begin
if EP_CheckupCopies(Total, Current) then
begin
MessageBox(0, PAnsiChar(format('There is set up %d of total executed copies,'#10#13'This is the %d-th runing copy!', [Total, Current])), 'Application', MB_OK or MB_ICONINFORMATION);
end else
begin
MessageBox(0, 'Unable to get executed copies count. To solve the problem, be sure:'#10#13'1. Application is protected,'#10#13'2. Checkup of executed copies is enabled.', 'Application', MB_OK or MB_ICONERROR);
end;
end;
See function examples in the installation folder, Examples\ExecutedCopies subfolder.