ocx控件打包发布问题的总结

来源:互联网 发布:什么软件打开psd文件 编辑:程序博客网 时间:2024/04/28 14:36

       我使用VC创建的ocx控件,其中包括MsgX.ocx,XMPP.dll,FaceCtrl.dll。它们之间的依赖关系是:MsgX.ocx调用了XMPP.dll,XMPP.dll又调用FaceCtrl.dll。

       ocx打包成cab时,inf文件这样写的:

      

[version]    signature="$CHINA$"    AdvancedINF=2.0  [DefaultInstall]CopyFiles=install.filesRegisterOCXs=RegisterFiles[RInstallApplicationFiles]CopyFiles=install.filesRegisterOCXs=RegisterFiles[DestinationDirs]install.files=11[SourceDisksNames]1=%DiskName%,MsgX.CAB,1[Add.Code]MsgX.ocx = MsgX.ocxXMPP.dll= XMPP.dllFaceCtrl.dll = FaceCtrl.dll[FaceCtrl.dll]file-win32-x86=thiscabFileVersion=1,0,0,1DestDir=10[XMPP.dll]file-win32-x86=thiscabFileVersion=1,0,0,1DestDir=10[install.files]MsgX.ocx=MsgX.ocx[SourceDisksFiles]MsgX.ocx=1[MsgX.ocx]file-win32-x86=thiscabclsid={D5A99FEE-1B8C-435A-B839-0DAB1E2E3788} FileVersion=1,0,0,1 DestDir=10RegisterServer=yes 
DestDir 可以为 10 则在 Windows 目录,为 11 则在 Windows/System(32)
目录,或为空则在 Occache 目录。
然后用Windows自带的iexpress.exe进行打包。
其中iexpress.exe为(C:/WINDOWS/system32/iexpress.exe)
最后是一段用于测试的jsp代码,大家可以拷贝做点修改直接使用:
<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><%! String basePath=null; %><% String path = request.getContextPath();     basePath = request.getScheme() + "://"                    + request.getServerName() + ":" + request.getServerPort()                    + path + "/";      // System.out.println("basePath+"+basePath);                                 %><html xmlns="http://www.w3.org/1999/xhtml"><head><script language="javaScript">function toTry(){try{if(DEMAO.DoTest()==1001){   document.getElementById("wait").innerHTML="";   alert("截屏插件安装完毕,你已经可以使用截屏功能!点击'确定'关闭本页面。");   try   {window.opener.location.reload();window.opener.focus();window.close();}catch(e){ window.close();}  }  }catch(e){window.setTimeout("toTry()",500);}}  </script>  <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>安装下载截图程序</title><style type="text/css"><!--.STYLE2 {color: #CC3300}.style3 {font-family: Arial, Helvetica, sans-serif}--></style></head><body topmargin="0" onLoad="toTry()"><p><p><p><!-- http://10.130.43.59:80/ICSC/ --><OBJECT WIDTH=0 HEIGHT=0  CLASSID="CLSID:7B7CF61B-714A-4878-8793-155AC3AE3017"  codebase="<%=basePath %>CatchScreen.ocx#version=1.0.0.1" ID="DEMAO" name="DEMAO">    <PARAM NAME="_Version" VALUE="65536">    <PARAM NAME="_ExtentX" VALUE="2646">    <PARAM NAME="_ExtentY" VALUE="1323">    <PARAM NAME="_StockProps" VALUE="0">  </OBJECT><!--http:/// --> <span id=wait class="STYLE2">  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  &nbsp;截屏插件正在下载中,请等待...........  </span><br><br>安装步骤下图所示 :<br><br>(1)请等待IE页面上方出现的提示条,然后选中“安装ActiveX控件”单击。<br><img src="loadcab_files/screen_1.GIF" width="616" height="108"><br><br>(2)在弹出的提示框里,单击“安装”按钮。<br><br><img src="loadcab_files/screen_2.GIF" width="494" height="272"></p><p>(3)过一分钟左右,弹出提示框,提示“安装完毕!”,至此live800的截屏插件安装完成。<br>  <br><img src="loadcab_files/screen_3.GIF" width="452" height="139"></p><p>(4)如果没有成功弹出上面的安装步骤,请设置你的IE浏览器的工具中设置。</p><p><img src="loadcab_files/4.gif" width="414" height="481" /></p><p>(5)点击自定义级别进行设置。</p><p><img src="loadcab_files/5.gif" width="417" height="446" /></p><p>(6)进行上面的1-3步骤操作就ok了,可以进行恢复安全设置,以免其它病毒入侵。<br>  <br></p></body></html>