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 4

Top  Previous  Next

EXAMPLE 4

 

Items

In this example you will learn to

Protection schemes

Flowchart

Run the application

 

 

 

In this example you will learn to:

1. Using the component in a protection scheme with multiple modules (Scheme D).

 

 

Protection schemes

This example uses the scheme D

 

        Scheme D

layout03

 

It is implemented as shown in the following flowchart:

 

 

Flowchart

 

 

demo04a01

procedure TForm1.FormCreate(Sender: TObject);

begin

DoRegister(False);

end;

 

procedure TForm1.DoRegister(force:boolean);

var F : TRegForm;

  ok:boolean;

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;

if (keydata.Status = Registered) then begin

  Button1.Enabled := (IsValueOn(keydata.Values,3,0));

  Button2.Enabled := (IsValueOn(keydata.Values,3,1));

  Button3.Enabled := (IsValueOn(keydata.Values,3,2));

end else begin

  Button1.Enabled := False;

  Button2.Enabled := False;

  Button3.Enabled := False;

end;

end;

 

 

 

The scheme is similar to Example 3, the only change is that it has eliminated the OnPaint event handler so now the main form will be accessible forever, even in unregistered state.

 

 

Brief practice with example 4a

 

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

 

demo04a02

 

 

Run the application

Hit the runbutton button or click F9 to start the program.  In moments you will see the registration form:

 

demo03a03

 

Note that the current registration status is "Not registered". This is because it is first executed the program and for "a" versions, the trial period is not started automatically.

 

We have two choices to start the trial period:

a) Offline way. Using the method MakeTrial () with the [Start Trial with MakeTrial ()] button.

b) Online way. Using the basic OLM with the [Start Trial with Basic OLM] button. The example is configured to access the site www.av-soft.com which you can use to do the practices.

 

If the status is not registered then when clicking the [Continue >>] button, the application will terminate, so the main form will be unaccessible.

 

If you click the [Continue >>] while the unregistered status, the application will not end as in example 3 but would continue and access the main form "Main Form", but only with the [Free Features] enabled. This is the only difference with Example 3.

 

demo04a03

 

Not shown here the rest of the steps, since these are the same as already explained in example 3.