我正在创建一个ActiveX
对象javascript
,并在该对象上调用一个方法。这工作得很好。但是,如果我尝试访问一个property
activeX 控件(或从被调用的方法返回一个值),浏览器就会崩溃(消息:IE 已停止工作)。在详细信息部分,它说System.StackOverflowException
没有被抓住。C#代码是:
interface IScreenshot{
int data {get; set;}
}
public class ScreenShot : UserControl, IScreenShot, IObjectSafety
{
public int data
{
get
{
return data;
}
set
{
data=13;
}
}
}
访问它的js代码是:
<script type="text/javascript" language="JavaScript">
var x = new ActiveXObject("Try1.ScreenShot");
var value = x.data;
</script>
详细错误是:
Problem signature:
Problem Event Name: CLR20r3
Problem Signature 01: iexplore.exe
Problem Signature 02: 9.0.8112.16448
Problem Signature 03: 4fecf1b7
Problem Signature 04: Try1
Problem Signature 05: 1.0.0.0
Problem Signature 06: 507399f0
Problem Signature 07: 5
Problem Signature 08: 0
Problem Signature 09: System.StackOverflowException
OS Version: 6.1.7601.2.1.0.768.11
Locale ID: 1033