OCX控件嵌入网页刷新不调用OnCreate
呀呀的呀 2011-12-29 10:23:47 我创建了一个OCX控件,第一次都有调用OnCreate函数,网页上打开也显示正常,但是我点击刷新或则按F5时,他很经常就卡住了。
我调试了下,发现刷新网页的时候,有的时候它会正常重新调用用控件的OnCreate()函数,但有的时候就是不调用,这是为啥。。。。
我自己也写了个接口给网页传参数,也是在刷新的时候有的时候有调用,有的时候没有被调用,第一调用都没有错。
请问下有没有谁遇到跟我一样的问题,什么情况会导致网页重新刷新时不调用控件的OnCreate()函数
htm文件如下:
<html>
<head>
<title>My Test</title>
</head>
<body style=" width:100%; height:100%; margin:0px; padding:0px; background-color:#000;">
<object ID="MyTest" style="position:absolute;"
CLASSID="CLSID:F50AAEB1-208D-4624-9C83-1B1E5BCA8072"
CODEBASE="http://.../MyTest.CAB#version=1,0,0,1" >
</object>
<div align=center style="margin:0px; padding:0px;">
<img src="images/Active_loading.gif" width=632 height=398 >
</div>
<script language=javascript>
window.onload=function()
{
MyTest.PrjName("Test")
MyTest.width = document.body.clientWidth;
MyTest.height= document.body.clientHeight;
}
</script>
</body>
</html>