Last Modified October 1, 2026

StreamLined Activation - Floating Licenses

  1. Introduction
  2. Revised Activation Flow

 

For Floating Licenses, follow the Muli-User StreamLined Activation implementation with the following additions:

  • At Application Start-up

    The Application needs to check if there is a Floating CDM that would have been created when the Application was last closed and de-activated to free up the "Seat".

    The Floating CDM is a special CDM file that contains the License Activation Code and the License Password which can be retrieved to re-activate the License on start-up of the Application.

  • On Application Close event

    De-activation of the License must occur in the "Close" Event Handler of the Application if this License is a Floating License.

 

Revised Activation Flow

On Start-Up
  • Authenticate the DNA Library

  • Set the CDM License File location

  • Check if there is a valid CDM License File with DNA_Validate

    • Yes, then run the application

    • No, proceed to Activate / Re-activate

Activation / Re-Activation
  • First, the Application should try to retrieve the following from the Floating CDM:

    • License Code using DNA_Param() with "ACTIVATION_CODE"

    • License Password using DNA_Param() with "PASSWORD"

  • If both are available, then do a DNA_Reactivate() call and if successful, run the application.

  • If either is <blank>, or the DNA_Reactivate() call fails, then continue to Step 1 of the StreamLined Activation process.

On Close Event

Free up the "Seat" for another User.

  • Check if this is a Floating License using DNA_Param() with "FLOATING".

    If not <blank>, then this is a Floating License (value could be 1, 2, etc)

  • Do a DNA_Param() with "PASSWORD" to retrieve the License Password.

  • Do a DNA_Deactivate() call with the License Password.

The DNA_Deactivate() API call will perform the following for a Floating License:

  • Disable the CDM license file on the User’s computer

  • Instruct the DNA Server to free-up (i.e. delete) the "Seat" for this computer which can then be used by another computer / user.

  • Create a Floating CDM which will only contain the License Activation Code and the License Password, which can be retrieved at the next start-up.

 

Code Sample

Logic to add before Step 1 of the StreamLined Activation Process for Floating Licenses

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

                	
                        // Try to retrieve the Activation Code and Password from a Floating CDM that would have been left
                        // after a de-activation
                        
                        DNA_Param("ACTIVATION_CODE",buffer,sizeof(buffer));
                        DNA_Param("PASSWORD",buffer2,sizeof(buffer2));
                        
                        if ((*buffer != '\0')  && (*buffer2 != '\0'))
                        	
                            {
                                // have both the License Code and the Password
                                // assign to activation_code and password variables
                                
                            
                                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
                                    }
                            }
                                        
                        
                                
                        // do not have the License Code or the Password
                        // proceed to Step 1 of the StreamLined Activation Process
                        //
                    
                

De-Activate the License in Application Close Event

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

                	
                        //************** De-Activation code **********************//
                            
                        //
                        // For de-activation of the License to free up this seat for another User
                        //
                        // This code should be in the Close Event Handler of your Application
                        //
                        
						DNA_Param("FLOATING",buffer,sizeof(buffer));

						if ( *buffer != '\0' ) 
                        
                        	{
                            	// a Floating License

                        		errNo = DNA_Deactivate(DNA_product_key, password);
                        
                                if (errNo == 0)
                                
                                    {
                                        // deactivation was OK, exit 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
                                        
                                    }
                            }