Use VB to make a cab package for a third party control (used on a Web page)

Source: Internet
Author: User
Tags ini manual writing win32
web| Control | The page uses VB to make the third party control a cab package (used on a Web page)
Due to the needs of the work, the author needs to display CAD files on the Web page (no CAD on the client machine). Due to time constraints, write control is not too late, there is no way to search the Internet a lap. Found a software, the size of about 8 trillion. Can be used to browse files of the DWG type. It was used to find that it was using a DLL-type control with two attached DLL files.

If you want to use a control on a Web page, the control needs to be typed into a cab-type package. On the internet to find a dozen cab bag tool, named IExpress. However, if you use this tool to package the need to write the INF file manually, the INF file structure is more complex, manual writing error prone. Think for a moment, think VB with the packaging tool can make CAB file package. However, VB packaging tools to start must choose a VB project. So with VB built a control with the name of the project, compiled a bit, and then with the VB with the tools to pack, packaged type choose the Internet type of installation package. To select a file this step, you need to remove the extra files, because this third-party control is not written by VB, so do not have to take VB Run-time Library. Add the main control DLL and two attached DLLs of the Third-party control to the package, and then start packing.

After the package has finished writing a test page, tried on the machine no problem (because the computer has already installed the control), so on the other machine test, not normal installation control, the page shows a red fork. View the control installation log file under the IE Temp folder, and the content display control does not register properly. Went to the internet to find some information, did not find the reason. Later, VC with the Dependency Walker tool to view the control of the DLL, found inside also contains three other DLLs, respectively: MSVCR71.dll, Msvcp71.dll, Mfc71.dll. The three files were added to the package, and after the test, everything was fine.



The script that uses the control on a Web page is as follows:



<HTML>

<HEAD>

<TITLE>BravaACX.CAB</TITLE>

</HEAD>

<BODY>

<!--If any of the controls on this page require authorization, you must

Create an Authorization package file. Run Lpk_tool. EXE to create

The requested LPK file. Lpk_tool. EXE will be found in the ActiveX SDK,

Http://www.microsoft.com/intdev/sdk/sdk.htm. If you have Visual

Basic 6.0 CD, you can find it in the \tools\lpk_tool directory.



The following is an example of an OBJECT tag:



<object classid= "clsid:5220cb21-c88d-11cf-b347-00aa00a28331" >

<param name= "LPKPath" value= "LPKFILENAME.LPK" >

</OBJECT>

-->



<object id= "Ctlbravaacxview" classid= "clsid:1be73243-a85f-4385-939d-14d4845a286a"

Codebase= "bravaacx.cab#version=5,1,0,5" width= "60%" height= "60%" >

<param name= "Filename" value= "DB_SAMP.DWG" >

</OBJECT>



</BODY>

</HTML>



The contents of the INF file for the packaged cab control are:



; Bravaacx.ocx INF File

;D Estdir can be 10 in the Windows directory, 11 in the Windows\System (32) directory, or empty in the Occache directory.



[Version]

Signature= "$CHICAGO $"

advancedinf=2.0

[DefaultInstall]

Copyfiles=install.files

Registerocxs=registerfiles

[RInstallApplicationFiles]

Copyfiles=install.files

Registerocxs=registerfiles

[DestinationDirs]

install.files=11

[SourceDisksNames]

1=%diskname%,bravaacx.cab,1



[Add.Code]

Bravaacx.dll=bravaacx.dll

Autorec.dll=autorec.dll

Bacxview.ini=bacxview.ini

Dwg2dl.dll=dwg2dl.dll

Myrdrv.ini=myrdrv.ini

Mfc71.dll=mfc71.dll

Msvcr71.dll=msvcr71.dll

Msvcp71.dll=msvcp71.dll

[Install.files]

Bravaacx.dll=bravaacx.dll

Autorec.dll=autorec.dll

Bacxview.ini=bacxview.ini

Dwg2dl.dll=dwg2dl.dll

Myrdrv.ini=myrdrv.ini

Mfc71.dll=mfc71.dll

Msvcr71.dll=msvcr71.dll

Msvcp71.dll=msvcp71.dll

[SourceDisksFiles]

Bravaacx.dll=1

Autorec.dll=1

Bacxview.ini=1

Dwg2dl.dll=1

Myrdrv.ini=1

Mfc71.dll=1

Msvcr71.dll=1

Msvcp71.dll=1



[BravaACX.dll]

File-win32-x86=thiscab

Registerserver=yes

CLSID={1BE73243-A85F-4385-939D-14D4845A286A}

destdir=11

fileversion=5,1,0,5



[Autorec.dll]

File-win32-x86=thiscab

Registerserver=no

destdir=11

fileversion=1,3,0,43



[Bacxview.ini]

File-win32-x86=thiscab

Registerserver=no

destdir=11

fileversion=0,0,0,0



[Dwg2DL.dll]

File-win32-x86=thiscab

Registerserver=no

destdir=11

fileversion=1,3,0,47



[Myrdrv.ini]

File-win32-x86=thiscab

Registerserver=no

destdir=11

fileversion=0,0,0,0



[MFC71.dll]

File-win32-x86=thiscab

Registerserver=no

destdir=11

fileversion=7,10,3077,0



[MSVCR71.dll]

File-win32-x86=thiscab

Registerserver=no

destdir=11

fileversion=7,10,3052,4



[Msvcp71.dll]

File-win32-x86=thiscab

Registerserver=no

destdir=11

fileversion=7,10,3077,0

[Registerfiles]

%11%\bravaacx.dll





Author: Ti Jianmin

Email:cuizm@163.com



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.