● How do I distribute controls in the web application? ● How to make my control respond to the mouse click? ● Can Active Server Pages (ASP) use controls? ● How to use the TREND control in the web page?
How do I distribute controls in the web application? We offer the following information for users who want to use controls in the web application. This is the documentation of the real extracted documentation from the Microsoft's Development Tool (MSDN) book. The files referenced in many places may be already old, please pay attention to the changes in these places. Note: All Century Flying Corporation has been named "Safe For Download" by a digital signature name. Microsoft Developer Network
When using your component on a Web page, there are additional considerations. The .ocx file and all supporting files must be on the target machine or downloaded across the Internet. This makes code size and download time an important consideration. Downloads can be packaged in A Signed .cab file.
Packaging code for Downloading
The codebase tag
ActiveX components are embedded in Web pages using the
Using the codebase tag with an ocx file
CODEBASE = "http://www.mysite.com/mycontrol.ocx#version=3,6,0,0" This solution downloads only the component's .ocx file and requires any supporting DLLs to already be installed on the client machine.
Using the codebase tag with an inf file
Codebase = "http://www.mysite.com/trustme.inf"
An .inf File Will Control The Installation of An .ocx File and ITS Supporting Files. This Method Is Not Recommended Because IT IS NOT (See Signing Code for Pointers On Code Signing).
Using the codebase tag with a capacity
Codebase = "http://www.somesite.com/acontrol.cab#version=1, 2, 0, 0"
Cabinet files are the recommended way to package ActiveX components in a cabinet file allows an .inf file to be included to component installation of the ActiveX component and any dependent DLLs. Using a CAB file automatically compresses the code for quicker download. If you are using a .cab file for component down, it is faster to sign the entire .cab file tour in Individual Component.creating Cab Files
The Cabinet Development Kit Can Be Obtained from The Microsoft Developers' Web Site, http://www.microsoft.com/workshop/. In this Kit, You Will Find The Necessary Tools To Construct Cabinet Files.
The cabinet file pointed to by CODEBASE should contain the .ocx file for your ActiveX component and an .inf file to control its installation. You create the cabinet file by specifying the name of your control file and an .inf file. Do not include dependent Dlls That May Already Exist On The System in this Cabinet file.
THE INF FILE
The following example, trend.inf, lists the supporting files and the version information needed for the VB TREND component. Notice the location for the VB DLLs is a Microsoft Web site. The * .cab is provided and signed by Microsoft.Contents of trend .inf: [TREND.OCX] file-win32-x86 = thiscabRegisterServer = yesDestDir = FileVersion = 3,5,0,0 [ASYCFILT.DLL] hook = AsycFilt.cab_InstallerFileVersion = 2,20,4118,1 [AsycFilt.cab_Installer] file-win32-x86 = http: //activex.microsoft.com/controls/vb5/AsycFilt.cabInfFile=AsycFilt.inf [MSVBVM50.DLL] hook = MSVBVM50.cab_InstallerFileVersion = 5,2,82,44 [MSVBVM50.cab_Installer] file-win32-x86 = http: //activex.microsoft.com/controls/vb5/MSVBVM50.cabInfFile=MSVBVM50.inf [Setup Hooks] AddToRegHook = AddToRegHook [AddToRegHook] InfSection = DefaultInstall [DefaultInstall] AddReg = AddToRegistry [AddToRegistry] / // hklm, "Software / Classes / CLSID / {9687C44A-906A-11D4-987D-Da7EAAB63647} / Implement Categories / {7DD95801-9882-11CF-9FA9-00AA 006C42C4} "HKLM," SOFTWARE / Classes / CLSID / {9687C44A-906A-11D4-987D-DA7EAAB63647} / Implemented Categories / {7DD95802-9882-11CF-9FA9-00AA006C42C4} "The
Param name = "gridStyle" value = "1"> object> in this case, trend.cab Will Contain Two files, trend.ocx and trend.inf. The folload: c: c: c: c: c: c: c: c: c: / capDevkit / Cabarc.exe -s 6144 n Trend.cab Trend.ocx Trend.infthe -s 6144 Parameter Reserves SPACE IN The Cabinet for Code Signing.
The Version Tag Note here that the #Version information specified with a CAB file applies to the component specified by the CLASSID parameter of the
Run LPKTOOL.EXE ON A Computer That IS licensed to use the component.
●
In The License Package Authoring Tool Dialog Box, In The Available Controls List Box, Select Each Licensed ActiveX Component That Will Be Used on The Html Page and Click Add. ●
Click Save & Exit and Type a name for the LPK File. This Will Create The LPK File and Close The Application.
To Embed a licensed Component on an HTML Page
●
Edit your HTML page. In the HTML page, insert an
●
Insert the
●
. Insert the
s been signed. A hash of the code is taken and embedded in the certificate. This hash is later compared with a hash of the code taken after the code is downloaded but before it runs. Companies such as Verisign can supply private and public keys needed to sign code. The ActiveX SDK ships with MakeCert, a utility for creating test certificates, and two registry files, wvtston.reg and wvtstoff.reg, for specifying whether or not the browser should recognize test certificates as valid. Internet Explorer Browser Safety Levels and Control Behavior A browser has options for safety level, configurable by the user. Because Web pages can contain active content that might potentially harm a user's computer, browsers allow the user to select options for safety level. Depending on the way a browser implements safety Levels, a Component May Not Be Downloaded At All, or Will Display a Certificate OR WARNING Message TO Allow The User To Choose At Run Time WHETER OR NOT To Download The Component. The behavior of ActiveX components under high, medium, and low safety levels on Internet Explorer is listed below. High Safety Mode ● Unsigned components will not be downloaded. ● Signed components will display a certificate if untrusted (a user can choose an option to always trust code from this certificate owner from now on). ● Only components marked as safe will have persistent data and / or be scriptable. Medium Safety Mode ● Unsigned components will display a warning before downloading. ● Signed components will display a certificate if untrusted. ● Components Not Marked AS Safe Will Display A Warning.low Safety Mode ● Components Are Downloaded WITHOUT WARNING. ● Scripting and personistence occur without warning.