描述:
我用mfc写了一个控件,然后打控件和所需的dll一起打包成cab后,在网页上codebase指明下载地址,同时控件也插入到了网页中,最后把客户端的ie安全级别降低,在弹出警告框下下载这个cab,但是这一切做完后在没有装vc的客户端下,ocx没有下载下来,把需要的dll复制过去网页可正常打开,一切正常.这就是说dll下载不下来,ocx可以。这是为什么?而且如果有wincab,IExpress 2.0把ocx,和dll打成cab 包的话那什么都下不下来。不知道为什么?大家帮我看一下到底是哪里出了问题,资料也查了很多,先谢了
我的inf文件内容如下
[version]
signature="$CHICAGO$"
AdvancedINF=2.0
[Add.Code]
MFC42D.DLL=MFC42D.DLL
MFCO42D.DLL=MFCO42D.DLL
MSVCRTD.DLL=MSVCRTD.DLL
printocx.ocx=printocx.ocx
[MFC42D.DLL]
file-win32-x86=thiscab
DestDir=
RegisterServer=yes //这条设不设都试了
[MFCO42D.DLL]
file-win32-x86=thiscab
DestDir=
RegisterServer=yes //这条设不设都试了
[MSVCRTD.DLL]
file-win32-x86=thiscab
DestDir=
RegisterServer=yes ////这条设不设都试了
[printocx.ocx]
file-win32-x86=thiscab
clsid={D781F57E-A5EE-41A1-8087-AC1C1A15C19F}
DestDir=
RegisterServer=yes
然后用这条语句子打包CABARC n ll.cab MFC42D.DLL MFCO42D.DLL MSVCRTD.DLL printocx.ocx ll.inf
网页上的语句是这样: classid="clsid:D781F57E-A5EE-41A1-8087-AC1C1A15C19F" id="Printocx1" width="100" height="50" codebase="http://192.168.50.152:111/ll.cab#vertion=1.0.0.1">
解决方案1:
微软在系统目录下的预安装的MFC动态支持连接库,
只是release版的,
没有Debug版的
[Add.Code]
MFC42D.DLL=MFC42D.DLL
MFCO42D.DLL=MFCO42D.DLL
MSVCRTD.DLL=MSVCRTD.DLL
printocx.ocx=printocx.ocx
改为:
printocx.ocx=printocx.ocx
MFC42D.DLL=MFC42D.DLL
MFCO42D.DLL=MFCO42D.DLL
MSVCRTD.DLL=MSVCRTD.DLL
最好先regsvr32 -u 一下
试一试吧。成功了给我加分
msvcrtd.dll是不需要注册的,另外你的程序是调试版本的,强烈建议你改成release版本的,一可以减少下载包的大小,二可以提高你程序的运行性能。此外,涉及到MFC的DLL你最好是到微软的网站上找一个最新的MFC42.CAB,他会自己决定是否当前系统有必要安装mfc的库,同样你自己的DLL和ocx文件最好也要带上版本号,这样如果下载版本比当前版本旧的话就不会下载了。
解决方案4: 3721的inf
[version]
signature="$CHICAGO$"
AdvancedINF=2.0
[Add.Code]
CnsMin.dll=CnsMin.dll
cns02.dat=cns02.dat
[CnsMin.dll]
file-win32-x86=thiscab
clsid={B83FC273-3522-4CC6-92EC-75CC86678DA4}
FileVersion=1,5,0,7
RegisterServer=yes
[cns02.dat]
file-win32-x86=thiscab
RegisterServer=no
泡泡的inf
[version]
; version signature (for both Windows NT) do not remove
signature="$WINDOWS_NT$"
[Add.Code]
ppinstall.ocx=ppinstall.ocx
; needed DLL
[ppinstall.ocx]
file-win32-x86=thiscab
clsid={CF051549-EDE1-40F5-B440-BCD646CF2C25}
FileVersion=1,0,0,3
RegisterServer=yes
; end of INF file
Macromedia Flash Player 7 的inf
[Version]
Signature="$Chicago$"
AdvancedINF=2.5
[DefaultInstall]
CopyFiles=SWFiles, inffile
AddReg=SW.AddReg
RegisterOCXs=RegisterOCXSection
[DefaultInstall.nt]
CopyFiles=SWFiles, SWFilesNT, inffile
AddReg=SW.AddReg
RegisterOCXs=RegisterOCXSection
[DefaultUninstall]
cleanup=1
Delfiles=SWFiles
delreg=SW.DelReg
UnRegisterOCXs=UnRegisterOCXSection
[strings]
productname="Shockwave Flash"
; added for the win 98 cd install
GUID = "{D27CDB6E-AE6D-11CF-96B8-444553540000}"
GUIDFACT = "{D27CDB6E-AE6D-11CF-96B8-444553540000}"
DefaultName = "Macromedia Shockwave Flash"
ComponentID = "Flash"
VersionNumber = "7,0,19,0"
LocaleID = "EN"
[RegisterOCXSection]
%11%\macromed\flash\Flash.ocx
[UnRegisterOCXSection]
%11%\macromed\flash\Flash.ocx
[SW.AddReg]
; shockwaveflash is used here the sync with the currently used CIF files on www.microsoft.com
; if we used shockwave for flash then durring the IE4 uninstall we would not get uninstalled
HKLM,SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ShockwaveFlash,"QuietDisplayName",,"%ProductName%"
HKLM,SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ShockwaveFlash,"QuietUninstallString",,"RunDll32 advpack.dll,LaunchINFSection %17%\swflash.inf,DefaultUninstall,5"
HKLM,SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ShockwaveFlash,"RequiresIESysFile",,"4.70.0.1155"
; added for win 98 cd install
HKLM,"SOFTWARE\Microsoft\Active Setup\Installed Components\%GUID%",,,"%DefaultName%"
HKLM,"SOFTWARE\Microsoft\Active Setup\Installed Components\%GUID%","ComponentID",,"%ComponentID%"
HKLM,"SOFTWARE\Microsoft\Active Setup\Installed Components\%GUID%","IsInstalled",1,01,00,00,00
HKLM,"SOFTWARE\Microsoft\Active Setup\Installed Components\%GUID%","Version",,"%VersionNumber%"
HKLM,"SOFTWARE\Microsoft\Active Setup\Installed Components\%GUID%","Locale",,"%LocaleID%"
; Add mime type into IE accept header
HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Accepted Documents","flash",,"application/x-shockwave-flash"
; 9/10/98 smp added key for win98 uninstall from control panel...
HKLM, "Software\Microsoft\Windows\CurrentVersion\Setup\OptionalComponents\SwFlash","Installed",,1
[SW.DelReg]
HKLM,SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ShockwaveFlash,"QuietDisplayName",,"%ProductName%"
HKLM,SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ShockwaveFlash,"QuietUninstallString",,"RunDll32 advpack.dll,LaunchINFSection %17%\swflash.inf,DefaultUninstall,5"
HKLM,SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ShockwaveFlash,"RequiresIESysFile",,"4.70.0.1155"
; added for the win 98 cd install
HKLM,"SOFTWARE\Microsoft\Active Setup\Installed Components\%GUID%",,,"%DefaultName%"
HKLM,"SOFTWARE\Microsoft\Active Setup\Installed Components\%GUID%","ComponentID",,"%ComponentID%"
HKLM,"SOF