实际上我想做的是一个activex,通过javascript可以访问它的property和method
对于简单类型,确实没有问题,可我们现在需要一个结构数组(或者类似的OBJECT)作为property,在javascript里面象下面这样访问
var myocx = new ActiveXObject("ourdll.testx") // new a activex object
var orders = myocx.orders; // to get a property from activex orders is the property I metioned before
var age = orders[1].age; // to get the property
//the property is an array and each element is a object(object) have a member variable named age
orders[0].age = 18;
orders[0].name = "jelly"; // to set the property
不知道该如何实现,也不知道什么地方有没有例子
对于简单类型,确实没有问题,可我们现在需要一个结构数组(或者类似的OBJECT)作为property,在javascript里面象下面这样访问
var myocx = new ActiveXObject("ourdll.testx") // new a activex object
var orders = myocx.orders; // to get a property from activex orders is the property I metioned before
var age = orders[1].age; // to get the property
//the property is an array and each element is a object(object) have a member variable named age
orders[0].age = 18;
orders[0].name = "jelly"; // to set the property
不知道该如何实现,也不知道什么地方有没有例子
这样才能在javascript中提供 var a = myocx["property"]的用法msdn sample
ms-help://MS.VSCC/MS.MSDNVS/dnmind99/html/dynamicobject.htm
谢谢,我找到那篇文章了,希望能有帮助.