I am a new ActiveX user. I am attempting to incorporate an ActiveX control into my page. I've been successful at opening and envoking all the Methods on my control. However, my control has an event called DaqUpdate() that it envokes to pass data from the control to the web page. My problem is that I can't seem to get the web page to recognize the event. I know it happens, because the control works in my MSExcel VBScript just fine.
I've implemented the following to react to the event... is this sufficient to react to a ActiveX event or am I missing something? (Obviously I am it doesn't work)
function DaqUpdate(lValueCount, pValues)
{
alert("DaqUpdate Called");
}
Here is the entire HTML page:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Com Object Tester 2</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<script language="JavaScript" type="text/JavaScript">
xDoc = new ActiveXObject("InGenius.DaqCtrl.1");
xDoc.UnregisterAllValues();
xDoc.RegisterValue("Throttle Angle");
xDoc.StartDaq(0);
if (xDoc==null)
{
alert('Error Loading ActivexObject');
}
alert("before function");
function DaqUpdate(lValueCount, pValues)
{
alert("DaqUpdate Called");
}
function closeUI()
{
xDoc.StopDaq();
xDoc.UnregisterAllValues();
}
</script>
<body onunload="closeUI()">
</body>
</html>
I've implemented the following to react to the event... is this sufficient to react to a ActiveX event or am I missing something? (Obviously I am it doesn't work)
function DaqUpdate(lValueCount, pValues)
{
alert("DaqUpdate Called");
}
Here is the entire HTML page:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Com Object Tester 2</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<script language="JavaScript" type="text/JavaScript">
xDoc = new ActiveXObject("InGenius.DaqCtrl.1");
xDoc.UnregisterAllValues();
xDoc.RegisterValue("Throttle Angle");
xDoc.StartDaq(0);
if (xDoc==null)
{
alert('Error Loading ActivexObject');
}
alert("before function");
function DaqUpdate(lValueCount, pValues)
{
alert("DaqUpdate Called");
}
function closeUI()
{
xDoc.StopDaq();
xDoc.UnregisterAllValues();
}
</script>
<body onunload="closeUI()">
</body>
</html>