IT Community - Software Programming, Web Development and Technical Support

Packaging the ActiveX control

This is a discussion on Packaging the ActiveX control within the C and C++ Programming forums, part of the Software Development category; Here I have given the procedure to package the ActiveX Control for putting in the web page. We have to ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C and C++ Programming

Register FAQ Members List Calendar Mark Forums Read
  3 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 03-27-2007, 05:10 PM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 299
Karpagarajan is on a distinguished road
Thumbs up Packaging the ActiveX control

Here I have given the procedure to package the ActiveX Control for putting in the web page.

We have to take care of the following steps
• Cabinet Files
• Packaging the Sample ActiveX Control
• Cabarc.exe
• INF Files
Cabinet Files
For a number of years, Microsoft used cabinet (.cab) files to compress software that was distributed on disks. Originally, these files were used to minimize the number of disks shipped with packaged product; today, .cab files are used to reduce the file size and the associated download time for Web content that is found on the Internet or corporate intranet servers.

The .cab file format is a nonproprietary compression format, also known as MSZIP, that is based on the Lempel-Ziv data-compression algorithm. (Other compression formats might also be supported later.)
Accessing Controls Stored in Cabinet Files
An ActiveX control is identified by the OBJECT object in an HTML file. If the control has been stored in a .cab file, OBJECT must include a CODEBASE attribute that specifies the URL for this .cab file. The following excerpt from a sample HTML file demonstrates how the OBJECT object and CODEBASE attribute are used.
<OBJECT CLASSID="clsid:dcf0768D-ba7a-101a-b57a-0000c0c3ed5f"
CODEBASE="http://webserver/time.cab"
ALIGN="CENTER" WIDTH=270 HEIGHT=26 ID="T1"><PARAM NAME="Interval" VALUE=1000>
<PARAM NAME="Enabled" VALUE=1></OBJECT>

Microsoft Cabinet Software Development Kit (SDK)
The Cabinet Software Development Kit provides developers with the components needed to use the Microsoft .cab file technology, or build .cab file management tools.
One of the tools available in the Cabinet Software Development Kit is Cabarc.exe. This command-line application enables you to compress an ActiveX control and store it in a .cab file. In addition to creating .cab files, you can use Cabarc.exe to list the contents of or extract files from an existing .cab file.
Installing the Cabinet Development Kit
To package an ActiveX control, it's necessary to install Cabarc.exe, a tool you download with the Cabinet Software Development Kit. When the Cabinet Software Development Kit is installed, you can begin using the tools it contains to build the necessary .cab files for your control.
Creating the .inf File
As previously stated, the sample .cab file bundles a Windows 95 or later .inf file with an x86 binary. The bundled .inf file contains information about the control, such as its name, its class identifier (CLSID), the name and location of required DLLs, whether the control requires registration, and so on. This .inf file has the following format.
[version]
signature="$CHICAGO$"
AdvancedINF=2.0
[Add.Code]
time.ocx=time.ocx
msvcrt.dll=msvcrt.dll
mfc42.dll=mfc42.dll
olepro32.dll=olepro32.dll
[time.ocx]
file-win32-x86=thiscab
clsid={DCF0768D-BA7A-101A-B57A-0000C0C3ED5F}
FileVersion=1,0,0,0
RegisterServer=yes
[msvcrt.dll]
FileVersion=4,20,0,6164
hook=mfc42installer
[mfc42.dll]
FileVersion=4,2,0,6256
hook=mfc42installer
[olepro32.dll]
FileVersion=4,2,0,6068
hook=mfc42installer
[mfc42installer]
file-win32-x86=http://activex.microsoft.com/controls/vc/mfc42.cab
run=%EXTRACT_DIR%\mfc42.exe
Building the .cab File
After you've installed Cabarc.exe and built the .inf file for your package, you can build the .cab file. In the case of the sample .cab file, this entailed running Cabarc.exe with the following arguments.

cabarc.exe -s 6144 N time.cab time.ocx time.inf

This command created a .cab file named Time.cab, which contains a compressed x86 binary for the sample control as well as a compressed version of the corresponding .inf file. The -s 6144 switch specifies that Cabarc.exe should allocate 6144 bytes for a digital certificate. (Code signing with digital certificates is described briefly in the next section).
Signing the .cab File
Use the Signcode.exe utility (and accompanying wizard), which also comes with Authenticode technology, to sign the .cab file.
signcode -prog mycab.cab -spc cert.spc -pvk mykey
If Signcode.exe is successful, it will have embedded a PKCS #7 certificate in the .cab file.
Hope you can understand how to package the activeX control.

thanks
__________________
Karpagarajan. R
Necessity is the mother of invention
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/c-c-programming/844-packaging-activex-control.html
Posted By For Type Date
Digg / Programming / Upcoming This thread Refback 07-20-2007 05:17 AM
Digg - Packaging the ActiveX control This thread Refback 07-20-2007 03:56 AM
digg / vinothchandar / news / dugg This thread Refback 07-20-2007 03:25 AM

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to control the webcam using C#? kingmaker C# Programming 5 12-02-2008 01:05 PM
How do I get the value of a form control? itbarota HTML, CSS and Javascript Coding Techniques 2 10-26-2007 04:13 AM
use of Custom Control and User Control? a.deeban ASP and ASP.NET Programming 1 08-20-2007 08:25 AM
What is an ActiveX method? prasath C and C++ Programming 1 07-30-2007 03:32 AM
Update to IE7 but the ActiveX Problems montyauto HTML, CSS and Javascript Coding Techniques 1 05-25-2007 01:18 AM


All times are GMT -7. The time now is 05:47 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0