valega.com
AVLock SIMPLE Online Help
Introduction
What is AVLock SIMPLE?
How to buy AVLock SIMPLE?
Acknowledgments
Using AVLock Simple
How to install AVLock SIMPLE?
Registration Keys
Configuration
Users and Instances
Protection Schemes
Examples
Example 1
Example 2
Example 3
Example 4
Example 5
Example 6
Example 7
Example 8
Properties
Methods
The Online License Manager (OLM)
HowTo's
The RegMonitor utility
The KeyGen utility
The CodeCheck utility
The KeyCheck utility
Additional Information
Changelog
License Agreement

Example 2

Top  Previous  Next

EXAMPLE 2

 

Items

In this example you will learn to

Protection schemes

Flowchart

Brief practice with example 2a

 

 

In this example you will learn to:

1. Use the component in a basic protection scheme (Scheme B).

 

 

Protection schemes

This example uses the scheme B

 

  Scheme B

layout02

 

It is implemented as shown in the following flowchart:

 

 

 

 

Flowchart

 

demo02a01

procedure TForm1.FormCreate(Sender: TObject);

begin

DoRegister(False);

end;

 

procedure TForm1.DoRegister(force:boolean);

var F : TRegForm;

begin

F:=TRegForm.Create(nil); //Create the registration Form

try

  if AVLockS41.IsLocal and (force or (keydata.DaysLeft < 15)) then F.ShowModal;

finally

  FreeAndNil(F);

end;

end;

 

procedure TForm1.Button2Click(Sender: TObject);

begin

special;

end;

 

procedure TForm1.special;

var F:TForm2;

begin

if (keydata.Status = Registered) then begin

  F:=TForm2.Create(nil);

  try

    F.showmodal;

  finally

    freeandnil(F);

  end;

end else showmessage('Special Features not allowed. Only available for registered users.');

end;

 

The scheme is similar to Example 1, the only change is that it has eliminated the OnPaint event which exits the application when the the registration status was not registered or authorized period had expired, also added the procedure "special" which is executed with the button "Button1" [Special Features].

 

What explained about the parameter "force" in the example 1 is also valid in this example.

 

Version (2a): is the development version, with the utilitarian section including buttons to start the trial period and delete the registration data in order to get back the application to its original status.

Version (2b):  is the final release, where the trial period starts automatically and the utilitarian section were removed.

 

 

Brief practice with example 2a

 

From the Delphi IDE open the example 2a (\Examples\2\a)

 

demo02a02

 

If you like you could follow the steps of the previous example: run the application, start the trial period, remove the registration, etc.