Protect a VC++ app with Quick License Manager
Following is a step-by-step procedure to protect a VC++ app (unmanaged C++). Note that the steps below assume you have a QLM License Server already setup.
1. Launch the QLM Management Console
2. Create a product from the “Define Product” tab or use the Demo 1.0 product if you are evaluating QLM.
3. Go to the "Protect your application tab":
Page 1: Select the product to protect and the License Server
Page 2: Select "VC++"
Page 3: Leave the default settings or customize the look & feel if needed. By default, QLM will bind the license to the Computer Name. You can select the binding of your choice by setting the QlmLicenseBinding property located in the section "6. Qlm License Properties".
Page 4a: Select the folder where your VC++ source code is located and click Save
Page 4b: Click Update Visual Studio Project and locate your *.vcxproj file. If this step fails, you can ignore the error and do the following to update your Visual Studio project:
Add LicenseValidator.cpp and LicenseValidator.h to your project
Copy QlmLicenseLib.dll, QlmLicenseLib.dll.manifest and QlmLicenseWizard.exe to your bin folder from where your application runs. These files can be found in: C:\Program Files\Soraco\QuickLicenseMgr\Redistrib\net4.0
Copy the generated XML file (YourProduct.lw.xml) to your bin folder from where your application runs.
Page 5: Click Finish
5. Open your VC++ project in Visual Studio
6. Add the following to your main view header file:
7. Add the following code to your main view cpp file, in the OnInitialUpdate method:
This completes the integration. The next time you open your VC++ application the OnInitialUpdate method should get triggered and perform the license validation.
To generate a license key for testing purposes:
Go to the Manage Keys tab.
Click "Create Activation Key"
Select the Product (Demo 1.0 for trials) and click OK.
Copy and Paste the generated Activation Key in the License Wizard launched when your application starts up and follow the steps in the wizard.
The files that you need to distribute with your application are:
QlmLicenseLib.dll
QlmLicenseLib.dll.manifest
QlmLicenseWizard.exe
XML file generated by the Protect Your Application Wizard
Troubleshooting Tips
If you run into compilation issues after adding the LicenseValidator class to your project, you can try the following:
include atlstr.h in LicenseValidator.h
include io.h in LicenseValidator.h
Define UNICODE in the pre-processor args (in VS project properties).
Add 'version.lib' to Additional Dependencies (in VS project properties).
If the <strongname.h> file is missing, download and install the .NET 4.8 Developer Pack.
Last updated