在IE浏览器中使用ActiveX方法吗? [英] ActiveX methods for use in IE Browser?

查看:338
本文介绍了在IE浏览器中使用ActiveX方法吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我非常了解如何在HTML中使用activeX控件的属性.但是,如何在HTML中访问activeX的方法呢?我已经尝试过Google,ehow,堆栈溢出和其他站点.没事.我的自定义C ++ ActiveX完美地嵌入了网页中,但是除非我可以使用这些方法,否则它是无用的.顺便说一句-方法和属性之间有什么区别?它们是相同的,只是方法更好,因为它们在语法中可以有多个愚蠢的参数. (AFAIK)

I''m very aware of how to use an activeX control''s properties in HTML. But how do you access the methods of an activeX in HTML? I''ve tried google, ehow, stack overflow, and other sites. Nothing worked. My custom C++ ActiveX embeds in the webpage perfectly, but it''s useless unless I can use the methods. BTW - What is the difference between methods and properties? they are the same except methods are better because they can have more than one stupid parameter in the syntax. (AFAIK)

推荐答案

您只需使用点运算符-就像在vb中一样.
以以下示例为例:
You just use the dot operator - the same as you do in vb.
Take this sample for example:
var excelApp=null, excelFile=null, excelSheet=null;

function initExcel(filename)
{
  excelApp = new ActiveXObject("Excel.Application");
  excelFile = excelApp.Workbooks.Open(filename);
  excelSheet = excelApp.Worksheets('Sheet1');
}



至于方法/属性-它们只是名称的隐含含义-属性保存有关对象的信息,方法是对象可以做的事情(功能).

WorkBooks是一个属性,Open是该属性的方法.
工作表是excelApp的另一个属性.

属性可以是简单的类型,例如int,char,byte等-或它们可以是具有多个属性/方法的对象.

但简而言之-属性=数据,方法=函数. :)



As for methods/properties - they''re quite simply what their names imply - properties hold information about the object, methods are things that the object can do (functions).

WorkBooks is a property, Open is a method of that property.
Worksheets is another property of excelApp.

Properties can be simple types, like int, char, byte etc - or they can be objects with several properties/methods.

But in short - property=data, method=function. :)


这篇关于在IE浏览器中使用ActiveX方法吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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