Developer cookbook

This procedure shows the minimal steps required for a developer to allow CoolSoftCAD to use the Licensing framework. For a complete example of the required code, see "Example licensed product implementation" on page 129. This example shows licensing at a coarse granularity level. For examples of more complex implementations, see "Extensions to the cookbook" on page 145.

  1. Define a derived class of the abstract base class TLicenseUse.
          class TCoolSoftCADLicenseUse : public TLicenseUse { 
          public: 
          ... 
          private: 
          ... }
  2. Define required overrides for abstract member functions.
    1. SelectProvider
              TCoolSoftCADLicenseUse ::SelectProvider (TLicenseProduct& selection, 
                                   const TCollectionOf<TLicenseProduct>& providers) 
              { ... }
    1. GetOperations
              TCoolSoftCADLicenseUse ::GetOperations (const TLicenseProduct&
                                      theProviderProduct, 
                                      TCollectionOf<TProviderOperation>& theOperations) 
              { ... }
    1. AcceptOperationsResults
              TCoolSoftCADLicenseUse ::AcceptOperationsResults (const TLicenseProduct&
                                      theProviderProduct,
                                      const TCollectionOf<TProviderOperation>& theOperations) 
              { ... }
    1. ReportException
              TCoolSoftCADLicenseUse :: ReportException (const TStandardException& exception) 
              { ... }
  3. Instantiate an object of your derived class.
        static TCoolSoftCADLicenseUse gCoolSoftCADLicenseUse; 
  4. If the check is successful, the user has access to the licensed product.
        gCoolSoftCADLicenseUse.Check(); 
    During the check for each available provider, the Licensing framework interacts with the derived class of TLicenseUse, and iterates through the following member functions:
    1. SelectProvider
    2. GetOperations
    3. GetNumberofUnits
    4. AcceptOperationsResults
    If the check is not successful because no license could be found for any available provider, the licensed product's override for ReportException is called:
    1. ReportException

[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker