Last Modified October 1, 2026

Custom Activation - Activate / Re-Activate the License

  1. Step 1 : Query the License Status
  2. Step 2 : Capture additional information for Activation / Re-Activation

Step 1 : Query the License Status

  • Capture a License Code from the User via a dialog box. For example:

    Example Activation Screen
  • Use the DNA_Query API Call to determine the status of the License Code

Results from DNA_Query API Call:

errNo = 8 (ERR_ACTIVATION_EXPECTED)

This is the initial activation of the following license types:

  • a Single-User / Multi-Computer license with the "Roll-Over Re-Activation
errNo = 9 (ERR_REACTIVATION_EXPECTED)

This is the activation of an additional computer or re-activation of a computer for the following license types:

  • a Single-User / Multi-Computer license with the "Roll-Over Re-Activation
errNo = 19 (ERR_ACTIVATION_EXPECTED_MU)

This is the initial activation of the following license types:

  • a Single-User / Multi-Computer license without the "Roll-Over Re-Activation
  • Multi-User License
  • Floating License
errNo = 20 (ERR_REACTIVATION_EXPECTED_MU)

This is the activation of an additional computer / seat or re-activation of a computer / seat for the following license types:

  • a Single-User / Multi-Computer license without the "Roll-Over Re-Activation
  • Multi-User License
  • Floating License

 

Step 2 : Capture additional information for Activation / Re-Activation

Based on the status of the License determined using the DNA_Query API call, proceed to capture additional information from the User and do an Activation or Re-activation.

The additional information that you need to capture from the User via your own dialog boxes, will depend on the License type / options and if this is an initial activation or seat activation, or re-activation as follows:

License Type Options Capture this additional information
Single-User
  • Roll-over Re-activation
  • User Authentication

On Activation:

  • License password (max 16 chars)
  • Email (optional)

On Re-activation:

  • Current License Password
  • New and Never Used Password
Single-User
  • No Roll-Over Re-activation
  • User Authentication

On Activation:

  • License password (max 16 chars)
  • Email (optional)

On Re-activation:

  • Current License Password
Single-User
  • No Roll-Over Re-activation
  • No User Authentication

On Activation:

  • Email (optional)

On Re-activation:

  • No info required
Multi-User
Floating
  • No Roll-Over Re-activation
  • User Authentication

On 1st seat Activation:

  • License password (max 16 chars)
  • Email (optional)

On other seat activation or Re-activation:

  • Current License Password

The Email is optional but recommended. A lost password can be resent using the DNA_SendPassword API call from the application, or from the DNA Control Panel, or from the License Manager Portal.

If your product does not use "User Authentication", then you will need to define (hard-code) a "global" default password in your application to be used by all Licenses and used in all DNA API calls.
See User Authentication     for information on using or not using User Authentication.

With the above information, and based on the status of the License Code, you would then issue one of the following:

  • DNA_Activate API Call
  • DNA_Reactivate API Call

Query and Activate or Re-Activate the License using CLASSIC Activation

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

                	
                        // Implement the 2-step Activation / Re-activation process
                        // 
                        // Step 1 : get License code and call DNA_Query() to determine license status
                        // Step 2 : get additional info and call DNA_Activate or DNA_Reactivate() 
                        //          based on status
                        //
                        
                        // Step 1
                        
                        // get an Activation Code from the User via a dialog box
                        
                        // use DNA_Query() to determine if activate or re-activate
                        
                        errNo = DNA_Query(DNA_product_key,activation_code);
                        
                        // DNA_Query returns:
                        //    - ERR_ACTIVATION_EXPECTED(8) = Single-User License with Roll-Over needs to be activated 
                        //      for the 1st time
                        //    - ERR_REACTIVATION_EXPECTED(9)  = Single-User License with Roll-Over already activated, 
                        //      needs to be re-activated
                        //    - ERR_ACTIVATION_EXPECTED_MU(19) = Single-User License without Roll-Over, Multi-User or Floating License needs to 
                        //      be activated for the 1st time
                        //    - ERR_REACTIVATION_EXPECTED_MU(20) = Single-User License without Roll-Over, Multi-User or Floating License already activated, 
                        //      this is a new seat activation, use DNA_Reactivate()
                            
                        // if the code does not exist, DNA_Query() will return 8 as though an activation
                        
                        //
                        // Step 2 : based on DNA_Query() result, complete the process
                        //
                        
                        if ((errNo == ERR_ACTIVATION_EXPECTED) || (errNo == ERR_ACTIVATION_EXPECTED_MU))
                        
                                {
                                	// this is an activation, get a password and email address
                        
                        			// if your product does not use User Authentication (i.e. a License
                        			// password), then use a hard-coded non-blank string as a "global"
                        			// Password
                        
                                    // get password and email address from User via dialog box
                        
                                	// you may want to validate the inputs, at a minimum:
                                	// - not >blank<
                                	// - password length not > 16 characters, no spaces
                               	 	// - valid email format
                        
                                     errNo = DNA_Activate(DNA_product_key, activation_code, license_password, license_email);
                        
                                     // check result code
                                     // - errNo > 0 means failure
                                     // - errNo = 0 and errNo < 0 means success
                                     // see Developer Guides for the full list of return codes
                                     // here we have only simple error checking in place
                        
                                     if (errNo <= 0 )
                        
                                		{
                        					// success, run the application
                                    	}
                                     else
                                    	{
                        
                                    		// error occurred, quit the application
                        
                        					// optionally, you can display an error message
                        					// you can use DNA_ERROR() which translate 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
                                       }
                        
                            	}
                        
                            
                        if (errNo == ERR_REACTIVATION_EXPECTED)
                                {	
                                	// this is a reactivation for Single-User with Roll-Over Re-Activation
                        			// and User Authentication that requires a current password 
                        			// and NEW password
                        
                                    // get current and New password from User via dialog box
                        
                                	// you would also want to validate the inputs, at a minimum:
                                	// - not <blank>
                                	// - password length not > 16 characters, no spaces
                        
                                    // issue the DNA_Reactivate API call and report the result
                        
                                     errNo = DNA_Reactivate(DNA_product_key, activation_code ,license_password, license_new_password);
                        
                                    // check result code
                                    // - errNo > 0 means failure
                                    // - errNo = 0 and errNo < 0 means success
                       				// here we have only simple error checking in place
                        
                                     
                        
                            		if (errNo <= 0 )
                                		{
                        					// success, run the application
                                    	}
                                     else
                                    	{
                                    		// error occurred, quit the application
                        
                       						// optionally, you can display an error message
                        					// you can use DNA_ERROR() which translate 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
                                    	}
                        
                            		}
                        
                        if (errNo == ERR_REACTIVATION_EXPECTED_MU)
                                {	
                                	// this is a reactivation for the following license types:
                        			// - Multi-User, Floating
                        			// - Single-User without Roll-Over Reactivation
                        			// - Single-User without User Authentication
                        
                        			// if your product does not use User Authentication (i.e. a License
                        			// password), then use a hard-coded non-blank string as a "global" 
                        			// Password
                        
                                    // get License password from User via a dialog box
                        
                                    // issue the DNA_Reactivate API call
                        			// use <blank> for new password and report the result
                        
                                     errNo = DNA_Reactivate(DNA_product_key, activation_code, license_password,"");
                        
                                    // check result code
                                    // - errNo > 0 means failure
                                    // - errNo = 0 and errNo < 0 means success
                        			// here we have only simple error checking in place
                        
                            		if (errNo <= 0 )
                                		{
                        					// success, run the application
                                    	}
                                     else
                                		{
                                    		// error occurred, quit the application
                        
                        					// optionally, you can display an error message
                        					// you can use DNA_ERROR() which translate 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
                                    	}
                            	}