EP_RegSaveKey
EP_RegSaveKey function serves for saving the registration information. The place and path where the registration information will be stored should be defined in REGISTRATION FEATURES - Registration data storing panel.
Parameters
- Name - the registration name - a pointer to the null terminated ANSI string.
- Key - the registration key - a pointer to the null terminated ANSI string.
Return Value
If the function succeeds, the return value is 1. If the function fails, the return value is 0.
Remark
The function only saves the registration information. To make sure you save the correct registration information, you should verify it by means of the EP_RegCheckKey function. Otherwise, use the combine function EP_RegCheckAndSaveKey.
Definition
Show/Hide C++ function definition
extern "C" __declspec( dllimport ) __stdcall BOOL EP_RegSaveKey( char* Name, char* Key );
Show/Hide Delphi function definition
function EP_RegSaveKey( Name : PAnsiChar; Key : PAnsiChar) : boolean; stdcall;
Show/Hide Visual Basic function definition
Public Declare Function EP_RegSaveKey Lib "enigma_ide.dll" (Name As String, Key As String) As Boolean
Show/Hide C# (.NET) function definition
public class Enigma_IDE
{
[DllImport("enigma_ide.dll", CallingConvention = CallingConvention.StdCall)]
public static extern bool EP_RegSaveKey(string Name, string Key);
}
Examples
Show/Hide Delphi function example
uses
enigma_ide;
function ProcessRegistration(Name, Key : AnsiString) : boolean;
begin
Result := fasle;
if EP_RegCheckKey(PAnsiChar(Name), PAnsiChar(Key)) then
begin
MessageBox(0, 'The Registration Information is valid for this project!', 'Application', 0);
if EP_RegSaveKey(PAnsiChar(Name), PAnsiChar(Key)) then
begin
MessageBox(0, 'The Registration Information had been saved successfully!', 'Application', 0);
Result := true;
end else
MessageBox(0, 'The Registration Information can''t be save... Unknown reasons', 'Application', 0);
end else
MessageBox(0, 'The Registration Information is NOT valid!'#10#13'Try to enter this again!', 'Application', 0);
end;
Show/Hide C++ function example
#include "include/enigma_api.h"
#pragma link "include/enigma_ide.lib"
BOOL ProcessRegistration( char* Name, char* Key)
{
if (EP_RegCheckKey(Name, Key))
{
MessageBox(0, "The Registration Information is valid for this project!", "Application", 0);
if (EP_RegSaveKey(Name, Key))
{
MessageBox(0, "The Registration Information had been saved successfully!", "Application", 0);
return TRUE;
} else
{
MessageBox(0, "The Registration Information can''t be save... Unknown reasons", "Application", 0);
}
} else
{
MessageBox(0, "The Registration Information is NOT valid!\nTry to enter this again!", "Application", 0);
}
return FALSE;
}
See function examples in the installation folder, Examples subfolder.