windowsactive:active在web上使用小结,windows环境



环境:winxp + vc2003
1.也算不上原创大多是从msdn和书上来转载请保留作者:http://www.ctag.cn
或http://blog.csdn.net/waterpub而且很古老日记了翻出来贴在这里
有用就看看把msn:jinglexy at yahoo.com.cn
2.
创建个activex项目记下clsid号Dependency查看依赖库:msvcr71.dll, msvcp71.dll,
MFC71.dll
3.使用cab sdk打包:
CABARC.EXE n active5.CAB active5.inf active5.ocx
msvcp71.dll MFC71.dll msvcr71.dll
inf编写如下:(修改里面Control控件名和clsid号)
; = active5.inf


; This .inf file will control the ation of
the MFC Spindial
; control. This control has been compiled with
Visual C version 4.2.
; The FileVersion tags in the dependent DLLs
section _disibledevent=> AdvancedINF=2.0

[Add.Code]
active5.ocx=active5.ocx
; These are the necessary supporting DLLs for MFC
4.2 ActiveX Controls
mfc71.dll=mfc71.dll
msvcr71.dll=msvcr71.dll
msvcp71.dll=msvcp71.dll
; thiscab is a keyword which, in this , means
that active5.ocx
; can be found in the same .cab file as this .inf
file
; file-win32-x86 is an x86 platform specic
identier
; See the ActiveX SDK - ActiveX Controls - Internet
Component Download -
; Packaging component code for automatic download

[active5.ocx]
file-win32-x86=thiscab
; *** add your controls CLSID here ***
clsid={954C7F44-564F-4A19-8701-3C2A0327B6D0}
; Add your ocx\'s file version here.
FileVersion=1,0,0,1
RegisterServer=yes

; dependent DLLs
[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

; end of spindial.inf
=

4.生成spc证书:
makecert /sv \"key.pvk\" /n \"CN=hojydotcom\" VicAli.cer
cert2spc VicAli.cer VicAli.spc
5.对cab文件签名运行vs2003signcode.exe选择cab文件spc及pvk证书
密钥使用md5算法
6.web方式:
<OBJECT id=\"lyz_fax\" codeBase=\"active5.cab\"
height=\"100\"
width=\"100\"
id=\"clsid:954C7F44-564F-4A19-8701-3C2A0327B6D0\"
VIEWASTEXT>
</OBJECT>
当clsid不存在时会下载activexControl控件并安装
7.web显示设置安全级别为低
8.以上测试通过工具或配置文件编写参考msdn
9.到微软处购买证书(也可能是中国个部门具体情况不太清楚了)


Tags:  windowswebserver windows2008web windowsweb windowsactive

延伸阅读

最新评论

发表评论