Visual Basic Concepts

Licensing for ActiveX Components

When you add an ActiveX control to a Web page, you are distributing it to any users who download the control from the page. Unless you license the control, there is little to prevent an end user from taking your control and using it in their own applications. The license acts as a kind of copyright for your control, preventing unauthorized use.

Licensing ActiveX controls for use on the Internet is a complex subject. An expression in a license such as "used on one computer" has a totally different meaning on the Internet when the "one computer" may be an HTTP server that is hosting 200 different IP addresses. The software may be in-use (running in memory) on thousands of anonymous computers and never in use on the computer for which it was licensed. These issues should be reviewed before you license your ActiveX controls for use on the Internet.

This section explains Microsoft's current licensing scheme, how to implement it with Visual Basic, and how HTML authors can use it on their pages. A general discussion of some licensing issues is also included.

For More Information   See the Internet/Intranet/Extranet Services SDK on Microsoft's Web site for detailed information on the licensing model and the .lpk file.

Microsoft's Licensing Scheme

Visual Basic implements a licensing scheme that uses a mechanism that contains methods the computer uses to retrieve a control's licensing information and create instances of objects. This is the most common licensing scheme in use.

The basics of licensing through this scheme are:

  • Each HTML page using one or more licensed controls requires a license file (.lpk) that contains the license strings for each control.

  • Each HTML page can use only a single .lpk file, but a single .lpk file can be used for more than one page.

  • The .lpk file must be on the same server as the HTML page it covers.

  • The .lpk file must contain a plain text copyright notice to dissuade casual copying of .lpk files.

The License File

The license file is an .lpk file you associate with one or more HTML pages. It contains license strings for each ActiveX control on the pages to which it refers. You use the License Package Authoring Tool to create an appropriate license file for their pages. This tool, which is available in the Tools directory, presents you with a list of controls you can include in you license file.

A sample license file is shown below:

LPK License Package
//////////////////////////////////////////////////////
// WARNING: The information in this file is
// protected by copyright law and international
// treaty provisions. Unauthorized reproduction or
// distribution of this file, or any portion of it,
// may result in severe criminal and civil penalties,
// and will be prosecuted to the maximum extent
// possible under the law. Further, you may not reverse
// engineer, decompile, or disassemble the file.
//////////////////////////////////////////////////////
{3d25aba1-caec-11cf-b34a-00aa00a28331}
AQWWF/QT0BG9ewCg0QKOmo=
BQAAAA=yhtrFpw/zxGAdURFU1QAACkAAAB
DAG8AcAB5AHIAaQBnAGgAdAAgACgAYwApACAAMQA5ADkANQAsACAAMQA5ADkANgAg
AE0AYQBjAHIAbwBtAGUAZABpAGEALAAgAEkAbgBjAC4A=

Important   The License Package Authoring Tool won't create an entry in the .lpk file for your ActiveX control unless you check the Required License Key checkbox in the Project Options dialog of your control project.

The License Manager

You must embed an object called the license manager in the Web page from which a user will download your ActiveX controls. The license manager uses an OBJECT tag to reference the control's .lpk file. If you use the Package and Deployment Wizard to create your download, it produces the license manager and inserts it in the file for you.

The following is a sample of the license manager:

<!--    If any of the controls on this page require licensing, you must create a license package file. Run LPK_TOOL.EXE in the Tools directory to create the required .lpk file.
-->
<OBJECT CLASSID="clsid:5220cb21-c88d-11cf-b347-00aa00a28331">
    <PARAM NAME="LPKPath" VALUE="LPKfilename.LPK">
</OBJECT>

Note   You must replace the LPKPath and LPKfilename.LPK parameters in the example above with the path and name of your license file.

This HTML code identifies the .lpk file as an object with the class ID shown above.

For More Information   See "Licensing ActiveX Controls" in the ActiveX Controls section of the Internet/Intranet/Extranet Services SDK on Microsoft's Web site.

Other License Models

There are other licensing models besides Microsoft's scheme. One requires a key that varies with time. In this approach, the following steps occur:

  1. The browser makes a call to an HTTP server that examines the URL of the HTML page making the call.

  2. The server examines the user's IP location for run-time licenses, then returns a license key.

There are also other licensing mechanisms possible. For example, if run-time licenses are required, then Basic authentication, NT authentication, or other authentication may be required before the license file may be obtained.

For More Information   See the "Authentication and Security for Internet Developers" white paper at https://www.microsoft.com/workshop/server/asp/feature/security-f.htm for more information on basic text authentication and NT security.