Sky Software Homepage LogicNP Software Knowledge Base And FAQ

 
Contact Product Support    SearchSearch      Subscribe to the RSS feed for this forum

INFO: Licensing Plugins & Addins

 
Subscribe to the RSS feed for this forum  Forum Index -> CryptoLicensing For MFC
View previous topic :: View next topic  
Author Message
Support



Joined: 18 Jul 2005
Posts: 731

Posted: Fri Jun 26, 2009 11:39 am    Post subject: INFO: Licensing Plugins & Addins

The general scheme for licensing of plugins or addins is as follows:

In the constructor/initialization routine of your plugin/addin, use a trial license code generated using CryptoLicensing Generator - this trial code can specify any constraints you wish such as 'Max usage days', 'Max executions', 'Max unique usage days' etc. Further you can also limit the functionality of your plugin if its an evaluation license.

When the user enters a full license, you will pass it on to CryptoLicensing using the CCryptoLicense.SetLicenseCode function and then save it using CCryptoLicense.Save so that it will be used the next time your plugin is loaded.

Thus, if a full license is loaded (saved above), it will be get validated, otherwise the trial license will get validated by default.

Code:
CCryptoLicense cryptoLicense(LS_Registry, _T("<<validation key for your project>>"));

cryptoLicense.Load();
// Load license from registry
//    if (cryptoLicense.Load() == FALSE)
{
  // license not found in registry which means that the user has not yet entered a full license
  // Use a trial license
  cryptoLicense.SetLicenseCode(_T("<<trial license code>>"));
}

// check that the full license is valid or that the eval license is valid and not expired
if (cryptoLicense.GetStatus() != LS_Valid)
{
  AfxMessageBox(_T("license not valid/evalution expired"));
}

// license is valid

// we can check if its trial license and reduce functionality if so desired
if (cryptoLicense.IsEvaluationLicense())
{
  // reduce functionality is so desired
}

...
...
...

// user enters a full license

cryptoLicense.SetLicenseCode(_T("<<license code entered by user>>"));

if (cryptoLicense.GetStatus() != LS_Valid)
{
  AfxMessageBox("invalid license entered");
}
else
{
  // save license so that it will get loaded next time the plugin starts
  cryptoLicense.Save();
}
Back to top
Display posts from previous:   
Forum Index -> CryptoLicensing For MFC All times are GMT
Page 1 of 1

 
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group