githubEdit

Protect a VB6 app with QLM

[You can watch a video version of this guide herearrow-up-right]

Following is a step-by-step procedure to protect a VB6 application. Note that the steps below assume you have a QLM License Server already setup.

1. Launch QLM

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 "VB6, VBA, ..."

  • 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 QlmLicenseBindingarrow-up-right property located in the section "6. Qlm License Properties".

  • Page 4: Select the folder where your VB6 application is located and click Save

  • Page 5: Click Finish

4. Copy the following files to the folder where your VB6 application is located:

  • C:\Program Files\Soraco\QuickLicenseMgr\Redistrib\.net 4.0\QlmlicenseLib.dll

  • C:\Program Files\Soraco\QuickLicenseMgr\Redistrib\.net 4.0\QlmLicenseLib.tlb

  • C:\Program Files\Soraco\QuickLicenseMgr\Redistrib\.net 4.0\QlmCLRHost_x64.dll

  • C:\Program Files\Soraco\QuickLicenseMgr\Redistrib\.net 4.0\QlmCLRHost_x86.dll

  • C:\Program Files\Soraco\QuickLicenseMgr\Redistrib\.net 4.0\QlmLicenseWizard.exe

5. Open your VB6 application and add the following references:

  • c:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.tlb

  • c:\Windows\Microsoft.NET\Framework\v4.0.30319\mscoree.tlb

  • QlmLicenseLib.tlb

6. In your VB6 app, declare the following global variables

7. In your VB6 app's Form_Load events add the following code:

8. In your VBA code, add the code below:

9. Add the LicenseValidator.cls class (created in step 3 above) to your project as follows:

  • Right mouse click your project in VB6

  • Click Add and select "Class Module"

  • In the New tab, select "Class Module" and click Open

  • Copy the contents of the LicenseValidator.cls to the clipboard and paste it into the new class

  • Set the name of the class to "LicenseValidator"

This completes the integration. The next time you open your VB6 app, the Form_Open event 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 the steps in the wizard.

Last updated