Last Modified October 2, 2026

TurnKey Activation - Using DNA_ProtectionOK() API call

 

The DNA_ProtectionOK()API call is used to implement the complete software_DNA solution, including the Activation and Validation processes using the TurnKey Activation built-in interface screens (described below).

The default language used in the built-in dialog boxes is "English". You can change the language used in the dialog boxes by issuing the DNA_SetLanguage APi Call before calling the DNA_ProtectionOK API Call.

The parameters are:

<Product_Key>

It uniquely identifies your product in the software_DNA system

The <Product_Key> is emailed to you when you create a Product Configuration in the DNA Control Panel and is available under Product Configuration in the DNA Control Panel.

<Option>

Determines what is presented to the User by the built-in screens:

0

No Evaluation Code option will be presented to the User

1

Enables the Registration mode

A Evaluate button will be shown whereas the User will be asked for their email address to which software_DNA will send the Evaluation License Code

2

Enables the Evaluate Now mode

A Evaluate Now button will be shown whereas a random Evaluation License Code will be allocated and immediately activated.

3

Supported by V7.00 or later

The License De-Activation built-in screen will be presented requesting the License Password, and a License de-activation will be attempted.

See Evaluation License Codes     for how to set-up Trials and Demos.

<Use_MachineID>,

If set to "0", will use the <Email> to screen Evaluation License Code requests

If set to "1", will use the <MachineID> to screen Evaluation License Code requests

Key Results from DNA_ProtectionOK():

errNo = 0 (ERR_NO_ERROR)

The application can run. A valid License exists.

errNo = -1 (ERR_VALIDATION_WARNING)

The application can run. A valid License exists.

This is a special case with Level 3 Validation and the Anti-Fraud feature. It indicates the License has reached the Warning Period and you can provide a warning to the user that he must connect to the Internet before the end of this period, or the License will expire.
See Notes on ERR_VALIDATION_WARNING   .

errNo > 0

The application should not be allowed to run, or allowed to run with limited functionality (a "Demo" mode).

It is recommended to trap some error codes at this stage to provide your User with additional instructions on how to resolve the issue or contact your Technical Support.

See DNA API Error Codes     for the definition of the different Error Codes.

Calling DNA_ProtectionOK()

Highlighted lines indicate where additional code is required or needs to be modified.

                	
                        //
                        // call the DNA_ProtectionOK() API
                        //
                        // this example allows user to "Request Evaluation Code" (2nd parameter) and not
                        // screen using the <machineID> (3rd parameter)
                        
                        errNo = DNA_ProtectionOK(DNA_product_key,1,0);
                        
                        if (errNo <= 0)
                        
                            {
                                // valid license exists or activation was OK, run the application
                                
                            }
                        else
                        {
                        // error occurred, quit the application
                        
                        // optionally, you can display an error message
                        // you can use DNA_ERROR() which translates the errNo into a more
                        // user-friendly description, or use your own descriptions
                        
                                DNA_Error(errNo,buffer,sizeof(buffer));
                        
                        // display error explanation
                        // quit the application
                        }