One of the advantages of letting your application run in a web browser (instead of as a stand-alone .exe) is that there is no need to install it on each of the client's computers. This would be, of course, of little use if you still need to install Text Control. For this reason, Text Control is also available as a CAB file, which is automatically downloaded and installed when needed. Two changes are required to our sample program of Step 4 in order to make use of the CAB file
1. An additional OBJECT tag is inserted for a .lpk file. This file is not Text Control specific, but includes license information for all ActiveX controls you use on a HTML page in encrypted form. It must be in the same directory as the .html file.
<OBJECT CLASSID="clsid:5220cb21-c88d-11cf-b347-00aa00a28331" VIEWASTEXT> <PARAM NAME="LPKPath" VALUE="tx.lpk"> </OBJECT>
The .lpk file can be created by using a program called Lpk_tool.exe, which is included in the Microsoft ActiveX SDK that is available for download from www.microsoft.com.
2. TX Text Control's OBJECT tag is extended by a reference to the CAB file. You can put the CAB file anywhere on a file server or on a web server. The codebase = statement (below) needs to be updated with the respective path to the CAB file on your server.
<OBJECT classid="clsid:0edb0c01-c493-11e7-a629-0013d350667c" codebase="http://myserver.com/.../tx.cab" id=objTX width=600 height=400 > <PARAM NAME="ViewMode" VALUE="2"> <PARAM NAME="ScrollBars" VALUE="3"> <PARAM NAME="PageWidth" VALUE="12240"> <PARAM NAME="PageHeight" VALUE="15840"> <PARAM NAME="Text" VALUE="TX Text Control ActiveX in Internet Explorer"> </OBJECT>
You may like to test this sample application, running from your own hard disk. Depending upon where you have installed TX Text Control, the path to the CAB file in the object tag should look something like this:
codebase="file:///C:/Program Files/Text Control GmbH/TX Text Control 22.0/Cab/TX.CAB"
The code shown here is contained in Step6.htm in the IE\HTML sample source directory.