Distribute LEADTOOLS COM controls via the web

You’ve put our object tag in your code and have viewed your page on your development box. Everything works and looks great. Now it’s time to distribute your page so that other machines will see the same page. Most of the controls on your page will be standard Windows controls who’s DLLs are on most machines already (either standard with Windows or through Windows updates and Service Packs) and are unlicensed. So the only thing necessary to do to distribute them is to put the object tag in your code. Our control’s DLLs are not on most machines and our controls are licensed. So in distributing our controls, you will first need to package our DLLs in CAB, in order for them to be downloaded to the client’s machine, and next create an LPK file so that our control can be created.

How to Create a CAB file:

Please read the following from Microsoft’s Web Site. Also you can obtain CABARC.EXE from here too.  http://msdn.microsoft.com/library/default.asp?url=/workshop/components/activex/packaging.asp.

How to Link the Cab file to your ASP code:

In the object tag to the first control of ours you embed in your page add the following:

CodeBase=/controls/ltocx.cab height=242 width=350 … >

You can specify any path to your CAB file.

Steps in Creating a LPK file:

1.

Download the LPK Tool.exe from this link: http://download.microsoft.com/download/3/7/5/375cfebc-6421-48a0-b6b9-831c4265b9e0/lpk_tool.exe

2.

Run it.

 

You will see a list of all the controls on you machine in the Window to the left. Select the control(s) you are using and click the Add button. You will see them appear in the Window to the right. Once you have all the controls, click the Save and Exit button to create the LPK file.

How to Link the LPK file to your ASP code:

You must embed the Microsoft License Class Manager as the first object in your code. Add the object using the following code:

<object classid="clsid:5220cb21-c88d-11cf-b347-00aa00a28331" align="baseline" border="0" width="1" height="1" ID="Object1" >
 <param name="LPKPath" value="/CONTROLS/LTOCX.LPK">
</object>

After reading this, you should note that we provide a sample CAB file in your LEADTOOLS\Redist\COM\CABS folder.  You can open and view the contents of this CAB, however you cannot alter the contents as the CAB has been signed. We would suggest viewing our *.INF file and using portions in your *.INF to speed up the creation and to prevent mistypes.

Note:

To access to the .INF file, please contact Technical Support.

Also all the DLLs in the CAB allow just the LEAD Main Control to be distributed. You can have separate cabs files for each control if you wish.  Some CABs will not download if they are too large.

One other factor to note:

Before you create your LPK file you should alter our LTOCX*.lic file if you have any unlock keys.  This will unlock the support in our control without having to call our method UnlockSupport.  The very last 4 characters of our license file are “Inc.”  Immediately following (no spaces) the period, put a pipe ( | ) then the support you wish to unlock, and equals sign, the key, and then another pipe.  Ex.  Inc.|L_SUPPORT_DOCUMENT=key|

If you have more than one unlock key you can concatenate them like this: Inc|L_SUPPORT_GIFLZW=key|L_SUPPORT_TIFLZW=key|

Once you make the modification, save the file and then follow the steps for creating the LPK file.

If you experience any issues in distributing your control you can systematically test each piece of the puzzle.  You can first test your LPK file by distributing our Demo1.html found in your \LEADTOOLS\Examples\COM\WEBDEMOS\ folder.

Use the CAB file we ship in your LEADTOOLS\Redist\COM\CABS folder with this as well.  If all goes well, you know your LPK file is good.  Next replace our CAB file with your CAB file.  If all goes well you know your CAB file is good, leaving your ASP code to be the last factor.