ActiveX无法在客户端计算机上运行 [英] ActiveX not working on client machine

查看:167
本文介绍了ActiveX无法在客户端计算机上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为一个简单的hello world消息框运行activex控件。首先我创建了类库,我现在有了dll,然后我创建了HTML页面并调用了activeX控件:



 < span class =code-keyword><  !DOCTYPE  >  
< html >
< head >
< title > DemoActiveX < / title >
< / head >
< body >
< OBJECT id = DemoActiveX classid <跨度类= 代码关键字> = <跨度类= 代码关键字 > CLSID:400DCE17-4B26-4E59-9A88-AF39E2BE4A55 <跨度类= 代码关键字 >>
< / OBJECT >
< script type = text / javascript >
尝试 {
var obj = document .DemoActiveX;
if (obj){
alert(obj.SayHello());
} else {
alert( 没有创建对象!);
}
} catch (ex){
alert( 发生一些错误,错误信息为: + ex.Description);
}
< / 脚本 >
< / body >
< / html >





当我在我的机器上尝试过,我曾经使用regasm / codebasedll path来注册dll,它运行正常。



当我试图在另一台机器上运行时的问题,我按照接下来的步骤:1)我创建了安装项目并添加了dll文件。

2)我创建了.inf文件并尝试了两个内容:



 [版本] 
signature =$ CHICAGO $
AdvancedINF = 2.0
[Add.Code]
ActiveX .dll = ActiveX.dll

[ActiveX.dll]
file-win32-x86 = thiscab
clsid = 400DCE17-4B26-4E59-9A88-AF39E2BE4A55
FileVersion = 1,0,0,0
RegisterServer = yes

--- OR ---

[版本]
签名=$ CHICAGO $
AdvancedINF = 2.0

[设置挂钩]
install =安装

[安装]
运行= MSIEXEC.EXE /包 %EXTRACT_DIR%\DemoActiveXSetup.msi / QN





3)我创建了包含.inf和setup.exe文件的.CAB文件4)将HTML页面中的对象更改为:



 <   OBJECT     id   =  DemoActiveX    classid   =  clsid:400DCE17-4B26-4E59-9A88-AF39E2BE4A55    

codebase = ActiveXCAB.CAB > < / OBJECT >





当我试图在另一台机器上打开一个请求窗口打开请求打开CAB时,当我按下是没有发生任何事情!!!!!为什么它不打开setup.exe或msi文件?顺便说一句,当我安装手动设置文件将ActiveX工作!

解决方案
芝加哥


AdvancedINF = 2.0
[Add.Code]
ActiveX.dll = ActiveX.dll

[ActiveX.dll]
file-win32-x86 = thiscab
clsid = 400DCE17 -4B26-4E59-9A88-AF39E2BE4A55
FileVersion = 1,0,0,0
RegisterServer = yes

--- OR ---

[版本]
signature =


CHICAGO


I''m trying to run activex control for a simple hello world message box. First i created the class library and i have now the dll , then i created the HTML page and called the activeX control :

<!DOCTYPE>
<html>
<head>
      <title>DemoActiveX</title>
</head>
<body>
   <OBJECT id="DemoActiveX" classid="clsid:400DCE17-4B26-4E59-9A88-AF39E2BE4A55">
</OBJECT>
    <script type="text/javascript">
        try {
            var obj = document.DemoActiveX;
            if (obj) {
                alert(obj.SayHello());
            } else {
                alert("Object is not created!");
            }
        } catch (ex) {
            alert("Some error happens, error message is: " + ex.Description);
        }
    </script>
</body>
</html>



when i tried it in my machine i used to register the dll using regasm /codebase "dll path" and it worked fine.

The problem when i tried to run in another machine, i followed the coming steps : 1) I created setup project and added the dll file.
2) I created .inf file and tried two contents which are :

[version]
signature="$CHICAGO$"
AdvancedINF=2.0
[Add.Code]
ActiveX.dll=ActiveX.dll

[ActiveX.dll]
file-win32-x86=thiscab
clsid=400DCE17-4B26-4E59-9A88-AF39E2BE4A55
FileVersion=1,0,0,0
RegisterServer=yes

---OR---

[version]
signature="$CHICAGO$"
AdvancedINF=2.0

[Setup Hooks]
install=install

[install]
run=msiexec.exe /package """%EXTRACT_DIR%\DemoActiveXSetup.msi""" /qn



3) I created .CAB file which contains the .inf and setup.exe files 4) Changed the object in HTML page to be :

<OBJECT id="DemoActiveX" classid="clsid:400DCE17-4B26-4E59-9A88-AF39E2BE4A55" 

codebase="ActiveXCAB.CAB" ></OBJECT> 



when i tried to open the page on the other machine a request windows opened which request to open CAB ,when i press yes nothing happened !!!!! why it doesn''t open the setup.exe or msi file ?? BTW when i installed manually the setup file the activeX worked !

解决方案

CHICAGO


" AdvancedINF=2.0 [Add.Code] ActiveX.dll=ActiveX.dll [ActiveX.dll] file-win32-x86=thiscab clsid=400DCE17-4B26-4E59-9A88-AF39E2BE4A55 FileVersion=1,0,0,0 RegisterServer=yes ---OR--- [version] signature="


CHICAGO


这篇关于ActiveX无法在客户端计算机上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆