Last Modified October 1, 2026

DNA_ProtectionOK() API

DNA_ProtectionOK(Product_Key, Option, Use_MachineID)

The The TurnKey (Do-All) Activation method is a turnkey implementation of software_DNA, in one easy API Call, with built-in User input screens for the complete activation process.

Parameters Description
<Product_Key>

The <Product_Key> of your DNA Product.

The <Product_Key> is emailed to you when you create a Product in the DNA Control Panel and is available under Product Configuration in the DNA Product 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

Set to "0" for Option=3 above

For list of Error Codes and descriptions, see DNA Error Codes    .

Example Built-in Activation Screen from the TurnKey (Do-All) Activation method with <option> = 1:

 

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.

The default language used in the generic 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.

 

Declarations and Examples

                      
                        
                        	FUNCTION DNA_PROTECTIONOK(PRODUCT_KEY:PANSICHAR; OPTION,USE_MACHINEID:INTEGER):INTEGER; STDCALL;
                      
                  
                      
                        
                        DECLARE FUNCTION DNA_PROTECTIONOK LIB "DNA.DLL" (BYVAL PRODUCT_KEY AS STRING, BYVAL OPTION AS INTEGER, BYVAL USE_MACHINEID AS INTEGER) AS INTEGER
                      
                  
                      
                        
                        INT __STDCALL DNA_PROTECTIONOK(CHAR *PRODUCT_KEY,INT OPTION,INT USE_MACHINEID);
                      
                  
                      
                        
                        INT __STDCALL DNA_PROTECTIONOK(CHAR *PRODUCT_KEY,INT OPTION,INT USE_MACHINEID);
                      
                  
                      
                        
                        INT __STDCALL DNA_PROTECTIONOK(CHAR *PRODUCT_KEY,INT OPTION,INT USE_MACHINEID);
                      
                  
                      
                        
                        PUBLIC NATIVE INT DNAPROTECTIONOK(STRING PRODUCT_KEY, INT OPTION, INT USE_MACHINEID);
                      
                  
                      
                        
                        DECLARE FUNCTION DNA_PROTECTIONOK LIB "DNA.DLL" (BYVAL PRODUCT_KEY AS STRING, BYVAL OPTION AS SHORT, BYVAL USE_MACHINEID AS SHORT) AS SHORT
                      
                  
                      
                        
                        PUBLIC STATIC EXTERN INT DNA_PROTECTIONOK(STRING PRODUCT_KEY, INT OPTION, INT USE_MACHINEID);