FoxInCloud
new activeX issue
Gravatar is a globally recognized avatar based on your email address. new activeX issue
  Tuvia Vinitsky
  All
  Aug 3, 2015 @ 08:34pm
When I instantiate the <OBJECT> activeX it works fine. But if I "close" the form, which is a child form, and then open it again, it's mess. The object is still there, but it can no longer be communicated with. calling its method that just checks for its existance returns false.

And it is not enough to refresh, I have to actually stop and start the server.

Where do I go?

Gravatar is a globally recognized avatar based on your email address. Re: new activeX issue
  Tuvia Vinitsky
  Tuvia Vinitsky
  Aug 3, 2015 @ 08:40pm
Mistake - I have to restart the browser, not the server.

I am almost crazy after about 60 hours with this control.


When I instantiate the <OBJECT> activeX it works fine. But if I "close" the form, which is a child form, and then open it again, it's mess. The object is still there, but it can no longer be communicated with. calling its method that just checks for its existance returns false.

And it is not enough to refresh, I have to actually stop and start the server.

Where do I go?

Gravatar is a globally recognized avatar based on your email address. Re: new activeX issue
  FoxInCloud Support - Thierry N.
  Tuvia Vinitsky
  Aug 3, 2015 @ 10:11pm
The first reason I would think of: when the activeX is destroyed, its event handlers are still hanging around.
Prototype does a good job releasing the event handlers whenever an element is destroyed

I would try:

$('SigPlus1').observe('PenDown', sigPenDown); // or function(event){}

also the author of this post may help you:
http://stackoverflow.com/questions/10236040/how-to-access-topaz-signature-pad-activex-object-through-javascript


When I instantiate the <OBJECT> activeX it works fine. But if I "close" the form, which is a child form, and then open it again, it's mess. The object is still there, but it can no longer be communicated with. calling its method that just checks for its existence returns false.

And it is not enough to refresh, I have to actually stop and start the server.

Where do I go?


-- thn (FoxInCloud)

Gravatar is a globally recognized avatar based on your email address. Re: new activeX issue
  Tuvia Vinitsky
  Thierry Nivelet (FoxInCloud)
  Aug 3, 2015 @ 10:28pm
I am somewhat ignorant about the prototype observe function, and reading the prototype docs on it confused me further.

What do I get from this and where would I use it?

thanks


The first reason I would think of: when the activeX is destroyed, its event handlers are still hanging around.
Prototype does a good job releasing the event handlers whenever an element is destroyed

I would try:

$('SigPlus1').observe('PenDown', sigPenDown); // or function(event){}

also the author of this post may help you:
http://stackoverflow.com/questions/10236040/how-to-access-topaz-signature-pad-activex-object-through-javascript


When I instantiate the <OBJECT> activeX it works fine. But if I "close" the form, which is a child form, and then open it again, it's mess. The object is still there, but it can no longer be communicated with. calling its method that just checks for its existence returns false.

And it is not enough to refresh, I have to actually stop and start the server.

Where do I go?


Gravatar is a globally recognized avatar based on your email address. Re: new activeX issue
  FoxInCloud Support - Thierry N.
  Tuvia Vinitsky
  Aug 3, 2015 @ 10:37pm
you could try this

procedure wcHTMLgen
LPARAMETERS toHTMLgen AS awHTMLgen OF awHTML.prg, tlInnerHTML

this.wcHTML = filetostr('mycoolhtml.inc')

toHTMLgen.cScriptJSadd([$('SigPlus1').observe('PenDown', sigPenDown);])


I am somewhat ignorant about the prototype observe function, and reading the prototype docs on it confused me further.

What do I get from this and where would I use it?

thanks


The first reason I would think of: when the activeX is destroyed, its event handlers are still hanging around.
Prototype does a good job releasing the event handlers whenever an element is destroyed

I would try:

$('SigPlus1').observe('PenDown', sigPenDown); // or function(event){}

also the author of this post may help you:
http://stackoverflow.com/questions/10236040/how-to-access-topaz-signature-pad-activex-object-through-javascript


When I instantiate the <OBJECT> activeX it works fine. But if I "close" the form, which is a child form, and then open it again, it's mess. The object is still there, but it can no longer be communicated with. calling its method that just checks for its existence returns false.

And it is not enough to refresh, I have to actually stop and start the server.

Where do I go?




-- thn (FoxInCloud)

Gravatar is a globally recognized avatar based on your email address. Re: new activeX issue
  Tuvia Vinitsky
  Thierry Nivelet (FoxInCloud)
  Aug 4, 2015 @ 05:54am
That did not seem to help me.


you could try this

procedure wcHTMLgen
LPARAMETERS toHTMLgen AS awHTMLgen OF awHTML.prg, tlInnerHTML

this.wcHTML = filetostr('mycoolhtml.inc')

toHTMLgen.cScriptJSadd([$('SigPlus1').observe('PenDown', sigPenDown);])


I am somewhat ignorant about the prototype observe function, and reading the prototype docs on it confused me further.

What do I get from this and where would I use it?

thanks


The first reason I would think of: when the activeX is destroyed, its event handlers are still hanging around.
Prototype does a good job releasing the event handlers whenever an element is destroyed

I would try:

$('SigPlus1').observe('PenDown', sigPenDown); // or function(event){}

also the author of this post may help you:
http://stackoverflow.com/questions/10236040/how-to-access-topaz-signature-pad-activex-object-through-javascript


When I instantiate the <OBJECT> activeX it works fine. But if I "close" the form, which is a child form, and then open it again, it's mess. The object is still there, but it can no longer be communicated with. calling its method that just checks for its existence returns false.

And it is not enough to refresh, I have to actually stop and start the server.

Where do I go?




Gravatar is a globally recognized avatar based on your email address. Re: new activeX issue
  FoxInCloud Support - Thierry N.
  Tuvia Vinitsky
  Aug 4, 2015 @ 07:16am
From what I read on SO posts, I'd rather put activeX controls on a master page

http://stackoverflow.com/questions/150814/how-to-handle-an-activex-event-in-javascript


That did not seem to help me.


you could try this

procedure wcHTMLgen
LPARAMETERS toHTMLgen AS awHTMLgen OF awHTML.prg, tlInnerHTML

this.wcHTML = filetostr('mycoolhtml.inc')

toHTMLgen.cScriptJSadd([$('SigPlus1').observe('PenDown', sigPenDown);])


I am somewhat ignorant about the prototype observe function, and reading the prototype docs on it confused me further.

What do I get from this and where would I use it?

thanks


The first reason I would think of: when the activeX is destroyed, its event handlers are still hanging around.
Prototype does a good job releasing the event handlers whenever an element is destroyed

I would try:

$('SigPlus1').observe('PenDown', sigPenDown); // or function(event){}

also the author of this post may help you:
http://stackoverflow.com/questions/10236040/how-to-access-topaz-signature-pad-activex-object-through-javascript


When I instantiate the <OBJECT> activeX it works fine. But if I "close" the form, which is a child form, and then open it again, it's mess. The object is still there, but it can no longer be communicated with. calling its method that just checks for its existence returns false.

And it is not enough to refresh, I have to actually stop and start the server.

Where do I go?






-- thn (FoxInCloud)

Gravatar is a globally recognized avatar based on your email address. Re: new activeX issue
  Tuvia Vinitsky
  Thierry Nivelet (FoxInCloud)
  Aug 4, 2015 @ 08:00am
I will try that; now it is 2 child forms down.


From what I read on SO posts, I'd rather put activeX controls on a master page

http://stackoverflow.com/questions/150814/how-to-handle-an-activex-event-in-javascript


That did not seem to help me.


you could try this

procedure wcHTMLgen
LPARAMETERS toHTMLgen AS awHTMLgen OF awHTML.prg, tlInnerHTML

this.wcHTML = filetostr('mycoolhtml.inc')

toHTMLgen.cScriptJSadd([$('SigPlus1').observe('PenDown', sigPenDown);])


I am somewhat ignorant about the prototype observe function, and reading the prototype docs on it confused me further.

What do I get from this and where would I use it?

thanks


The first reason I would think of: when the activeX is destroyed, its event handlers are still hanging around.
Prototype does a good job releasing the event handlers whenever an element is destroyed

I would try:

$('SigPlus1').observe('PenDown', sigPenDown); // or function(event){}

also the author of this post may help you:
http://stackoverflow.com/questions/10236040/how-to-access-topaz-signature-pad-activex-object-through-javascript


When I instantiate the <OBJECT> activeX it works fine. But if I "close" the form, which is a child form, and then open it again, it's mess. The object is still there, but it can no longer be communicated with. calling its method that just checks for its existence returns false.

And it is not enough to refresh, I have to actually stop and start the server.

Where do I go?






Gravatar is a globally recognized avatar based on your email address. Re: new activeX issue
  Tuvia Vinitsky
  Thierry Nivelet (FoxInCloud)
  Aug 4, 2015 @ 08:17am
No help, same problem, plus I have to find way for it not to display on the master form, as it has a display associated with it.


From what I read on SO posts, I'd rather put activeX controls on a master page

http://stackoverflow.com/questions/150814/how-to-handle-an-activex-event-in-javascript


That did not seem to help me.


you could try this

procedure wcHTMLgen
LPARAMETERS toHTMLgen AS awHTMLgen OF awHTML.prg, tlInnerHTML

this.wcHTML = filetostr('mycoolhtml.inc')

toHTMLgen.cScriptJSadd([$('SigPlus1').observe('PenDown', sigPenDown);])


I am somewhat ignorant about the prototype observe function, and reading the prototype docs on it confused me further.

What do I get from this and where would I use it?

thanks


The first reason I would think of: when the activeX is destroyed, its event handlers are still hanging around.
Prototype does a good job releasing the event handlers whenever an element is destroyed

I would try:

$('SigPlus1').observe('PenDown', sigPenDown); // or function(event){}

also the author of this post may help you:
http://stackoverflow.com/questions/10236040/how-to-access-topaz-signature-pad-activex-object-through-javascript


When I instantiate the <OBJECT> activeX it works fine. But if I "close" the form, which is a child form, and then open it again, it's mess. The object is still there, but it can no longer be communicated with. calling its method that just checks for its existence returns false.

And it is not enough to refresh, I have to actually stop and start the server.

Where do I go?






Gravatar is a globally recognized avatar based on your email address. Re: new activeX issue
  Tuvia Vinitsky
  Thierry Nivelet (FoxInCloud)
  Aug 6, 2015 @ 04:25am
I'm open to any ideas on this.


From what I read on SO posts, I'd rather put activeX controls on a master page

http://stackoverflow.com/questions/150814/how-to-handle-an-activex-event-in-javascript


That did not seem to help me.


you could try this

procedure wcHTMLgen
LPARAMETERS toHTMLgen AS awHTMLgen OF awHTML.prg, tlInnerHTML

this.wcHTML = filetostr('mycoolhtml.inc')

toHTMLgen.cScriptJSadd([$('SigPlus1').observe('PenDown', sigPenDown);])


I am somewhat ignorant about the prototype observe function, and reading the prototype docs on it confused me further.

What do I get from this and where would I use it?

thanks


The first reason I would think of: when the activeX is destroyed, its event handlers are still hanging around.
Prototype does a good job releasing the event handlers whenever an element is destroyed

I would try:

$('SigPlus1').observe('PenDown', sigPenDown); // or function(event){}

also the author of this post may help you:
http://stackoverflow.com/questions/10236040/how-to-access-topaz-signature-pad-activex-object-through-javascript


When I instantiate the <OBJECT> activeX it works fine. But if I "close" the form, which is a child form, and then open it again, it's mess. The object is still there, but it can no longer be communicated with. calling its method that just checks for its existence returns false.

And it is not enough to refresh, I have to actually stop and start the server.

Where do I go?






Gravatar is a globally recognized avatar based on your email address. Re: new activeX issue
  FoxInCloud Support - Thierry N.
  Tuvia Vinitsky
  Aug 6, 2015 @ 06:55am
https://social.msdn.microsoft.com/Forums/ie/en-US/47eccb01-8089-4653-a0ce-45e9ced5e228/addeventlistener-for-activex-events-in-ie11?forum=iewebdevelopment

We've been experiencing the same issue. We use an ActiveX component to control machinery via COM port. As many of our customers have recently received IE 11 as an automatic update, we have been receiving reports that the tool no longer works as expected. The ActiveX component is quite obviously running, because the machinery is being controlled, but none of the events produced are being registered in the browser window, reglardless of whether `attachEvent` or `addEventListener` is used.

Fortunately, there is a simple work-around: force IE 10 emulation, by adding the following to the document's `<head>`:
<meta http-equiv="X-UA-Compatible" content="IE=10" />
and then use `attachEvent`, as before.

https://social.msdn.microsoft.com/Forums/ie/en-US/bb5db2d7-aa05-49a6-bfaf-b6f32913ae8e/correct-way-to-handle-custom-activex-events-in-javascript?forum=iewebdevelopment

note: foxInCloud operates in standard mode

Hi,

You haven't specified a DTD (document type declaration) so MSIE browsers see your page as Quirks, so yes <script for= is (and always has been) valid for use with Quirks Mode...

Other browsers treat no DTD as a Unknown DTD and use the most standards compliant mode (HTML 4)... they do not recognise it as the for and event attributes of the <script> tag are MS proprietary.

Issues will arrise if your migrate to a Standards DTD and use AddEventListener or AttachEvent..... these methods cumulatively add event handlers to an element, so you can have a number of method attached to an element event handler...

see
http://www.quirksmode.org/js/events_advanced.html
and
http://www.idocs.com/tags/scripts/_SCRIPT_FOR.html

The above recommend that you do not use it.....
You should be looking at migrating away from Quirks see http://msdn.microsoft.com/en-us/library/cc288325(v=VS.85).aspx
Rob^_^




-- thn (FoxInCloud)
Gravatar is a globally recognized avatar based on your email address. Re: new activeX issue
  Tuvia Vinitsky
  Thierry Nivelet (FoxInCloud)
  Aug 6, 2015 @ 07:07am
I'm familiar with that post; the only thing that works is the SCRIPT FOR EVENT or the CONTROL::EVENT, I am using the latter. It works perfectly outside of FiC in a plain HTML page, but there I can use the FOR EVENT IE syntax. And in FiC it works the first time with the CONTROL::EVENT, but not subsequent times.


https://social.msdn.microsoft.com/Forums/ie/en-US/47eccb01-8089-4653-a0ce-45e9ced5e228/addeventlistener-for-activex-events-in-ie11?forum=iewebdevelopment

We've been experiencing the same issue. We use an ActiveX component to control machinery via COM port. As many of our customers have recently received IE 11 as an automatic update, we have been receiving reports that the tool no longer works as expected. The ActiveX component is quite obviously running, because the machinery is being controlled, but none of the events produced are being registered in the browser window, reglardless of whether `attachEvent` or `addEventListener` is used.

Fortunately, there is a simple work-around: force IE 10 emulation, by adding the following to the document's `<head>`:
<meta http-equiv="X-UA-Compatible" content="IE=10" />
and then use `attachEvent`, as before.

https://social.msdn.microsoft.com/Forums/ie/en-US/bb5db2d7-aa05-49a6-bfaf-b6f32913ae8e/correct-way-to-handle-custom-activex-events-in-javascript?forum=iewebdevelopment

note: foxInCloud operates in standard mode

Hi,

You haven't specified a DTD (document type declaration) so MSIE browsers see your page as Quirks, so yes <script for= is (and always has been) valid for use with Quirks Mode...

Other browsers treat no DTD as a Unknown DTD and use the most standards compliant mode (HTML 4)... they do not recognise it as the for and event attributes of the <script> tag are MS proprietary.

Issues will arrise if your migrate to a Standards DTD and use AddEventListener or AttachEvent..... these methods cumulatively add event handlers to an element, so you can have a number of method attached to an element event handler...

see
http://www.quirksmode.org/js/events_advanced.html
and
http://www.idocs.com/tags/scripts/_SCRIPT_FOR.html

The above recommend that you do not use it.....
You should be looking at migrating away from Quirks see http://msdn.microsoft.com/en-us/library/cc288325(v=VS.85).aspx
Rob^_^


Gravatar is a globally recognized avatar based on your email address. Re: new activeX issue
  FoxInCloud Support - Thierry N.
  Tuvia Vinitsky
  Aug 6, 2015 @ 10:19am
I assume the activeX control executes outside of the browser, as a separate Windows process bound to the browser window.
Maybe when the page closes, the activeX control's process still executes (can be checked using the Windows task manager).
When the page reopens, it just re-binds to the extant process. At this point it then may be impossible to re-define the events handlers.
To overcome this, it might help to attach the event handler function() to the browser window; something like:
window.myHandler = function(){...};
control::event = window.myHandler;


I'm familiar with that post; the only thing that works is the SCRIPT FOR EVENT or the CONTROL::EVENT, I am using the latter. It works perfectly outside of FiC in a plain HTML page, but there I can use the FOR EVENT IE syntax. And in FiC it works the first time with the CONTROL::EVENT, but not subsequent times.


https://social.msdn.microsoft.com/Forums/ie/en-US/47eccb01-8089-4653-a0ce-45e9ced5e228/addeventlistener-for-activex-events-in-ie11?forum=iewebdevelopment

We've been experiencing the same issue. We use an ActiveX component to control machinery via COM port. As many of our customers have recently received IE 11 as an automatic update, we have been receiving reports that the tool no longer works as expected. The ActiveX component is quite obviously running, because the machinery is being controlled, but none of the events produced are being registered in the browser window, reglardless of whether `attachEvent` or `addEventListener` is used.

Fortunately, there is a simple work-around: force IE 10 emulation, by adding the following to the document's `<head>`:
<meta http-equiv="X-UA-Compatible" content="IE=10" />
and then use `attachEvent`, as before.

https://social.msdn.microsoft.com/Forums/ie/en-US/bb5db2d7-aa05-49a6-bfaf-b6f32913ae8e/correct-way-to-handle-custom-activex-events-in-javascript?forum=iewebdevelopment

note: foxInCloud operates in standard mode

Hi,

You haven't specified a DTD (document type declaration) so MSIE browsers see your page as Quirks, so yes <script for= is (and always has been) valid for use with Quirks Mode...

Other browsers treat no DTD as a Unknown DTD and use the most standards compliant mode (HTML 4)... they do not recognise it as the for and event attributes of the <script> tag are MS proprietary.

Issues will arrise if your migrate to a Standards DTD and use AddEventListener or AttachEvent..... these methods cumulatively add event handlers to an element, so you can have a number of method attached to an element event handler...

see
http://www.quirksmode.org/js/events_advanced.html
and
http://www.idocs.com/tags/scripts/_SCRIPT_FOR.html

The above recommend that you do not use it.....
You should be looking at migrating away from Quirks see http://msdn.microsoft.com/en-us/library/cc288325(v=VS.85).aspx
Rob^_^




-- thn (FoxInCloud)

Gravatar is a globally recognized avatar based on your email address. Re: new activeX issue
  Tuvia Vinitsky
  Thierry Nivelet (FoxInCloud)
  Aug 6, 2015 @ 03:01pm
The problem is not specifically related to the custom handler, even without any custom handlers the control will not instantiate a second time without restarting the browser. I am going to strip the calls down the barest minimum and see if I can instantiate that.


I assume the activeX control executes outside of the browser, as a separate Windows process bound to the browser window.
Maybe when the page closes, the activeX control's process still executes (can be checked using the Windows task manager).
When the page reopens, it just re-binds to the extant process. At this point it then may be impossible to re-define the events handlers.
To overcome this, it might help to attach the event handler function() to the browser window; something like:
window.myHandler = function(){...};
control::event = window.myHandler;


I'm familiar with that post; the only thing that works is the SCRIPT FOR EVENT or the CONTROL::EVENT, I am using the latter. It works perfectly outside of FiC in a plain HTML page, but there I can use the FOR EVENT IE syntax. And in FiC it works the first time with the CONTROL::EVENT, but not subsequent times.


https://social.msdn.microsoft.com/Forums/ie/en-US/47eccb01-8089-4653-a0ce-45e9ced5e228/addeventlistener-for-activex-events-in-ie11?forum=iewebdevelopment

We've been experiencing the same issue. We use an ActiveX component to control machinery via COM port. As many of our customers have recently received IE 11 as an automatic update, we have been receiving reports that the tool no longer works as expected. The ActiveX component is quite obviously running, because the machinery is being controlled, but none of the events produced are being registered in the browser window, reglardless of whether `attachEvent` or `addEventListener` is used.

Fortunately, there is a simple work-around: force IE 10 emulation, by adding the following to the document's `<head>`:
<meta http-equiv="X-UA-Compatible" content="IE=10" />
and then use `attachEvent`, as before.

https://social.msdn.microsoft.com/Forums/ie/en-US/bb5db2d7-aa05-49a6-bfaf-b6f32913ae8e/correct-way-to-handle-custom-activex-events-in-javascript?forum=iewebdevelopment

note: foxInCloud operates in standard mode

Hi,

You haven't specified a DTD (document type declaration) so MSIE browsers see your page as Quirks, so yes <script for= is (and always has been) valid for use with Quirks Mode...

Other browsers treat no DTD as a Unknown DTD and use the most standards compliant mode (HTML 4)... they do not recognise it as the for and event attributes of the <script> tag are MS proprietary.

Issues will arrise if your migrate to a Standards DTD and use AddEventListener or AttachEvent..... these methods cumulatively add event handlers to an element, so you can have a number of method attached to an element event handler...

see
http://www.quirksmode.org/js/events_advanced.html
and
http://www.idocs.com/tags/scripts/_SCRIPT_FOR.html

The above recommend that you do not use it.....
You should be looking at migrating away from Quirks see http://msdn.microsoft.com/en-us/library/cc288325(v=VS.85).aspx
Rob^_^




Gravatar is a globally recognized avatar based on your email address. Re: new activeX issue
  Tuvia Vinitsky
  Thierry Nivelet (FoxInCloud)
  Aug 6, 2015 @ 03:25pm
This seems to definitely be related somehow to prototype etc.

I tried rather than calling a function in urt.js, I put the script in the form in wchtmlgen of an object. The code:

<script type="text/javascript">

SigPlus1.ClearTablet();
SigPlus1.TabletState = 1; //Turns tablet on to collect signature
if(SigPlus1.TabletState == 0)
{
alert("Cannot locate signature pad! Please check that it is connected before continuing.");
SigPlus1.TabletComTest = false;
return 0;
}
SigPlus1.LCDSetTabletMap(0, 240, 64, 100, 0, 1900, 700);

</script>


produces a prototype error at line 634
function evalScripts() {
return this.extractScripts().map(function(script) { return eval(script); });

ERROR: return statement outside of function.

The same code in urt.js but called from the objects wchtmlgen:

<script type="text/javascript">

sigSign();

</script>

works the first time the form is loaded. But if I "close" the form, it will not instantiate again. There are no error messages and stepping thru the code is no help, the code executes as it should but does not communicate with the device.

However if I just place the code in an HTML file and only include the JS scripts for the device, I have no problems at all. Like this works perfectly:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" charset="utf-8">
<head>
<script type="text/javascript" charset="utf-8" src="urtsig.js"></script>
<script type="text/javascript" charset="utf-8" src="SigWebTablet.js"></script>
</head>
<TABLE height=150 cellPadding=0 width=286 border=1 style="background-color:red" id="SigTable">
<TR>
<TD>
<OBJECT id=SigPlus1
style="WIDTH: 300px; HEIGHT: 150px" classid=clsid:69A40DA3-4D42-11D0-86B0-0000C025864A name=SigPlus1
VIEWASTEXT>
<PARAM NAME="_Version" VALUE="131095">
<PARAM NAME="_ExtentX" VALUE="4842">
<PARAM NAME="_ExtentY" VALUE="1323">
<PARAM NAME="_StockProps" VALUE="0">
</OBJECT>
</TD>
</TR>
</TABLE>

<script type="text/javascript">

function SigPlus1::PenDown()
{
// originally we used script type=javascript for=sigplus1 event=pendown (with correct case) and the FiC merge choked on it.
// this is the only other way to attach code to an activex custom method:
sigPenDown();
}
</script>
<script type="text/javascript">

sigSign();

</script>


I assume the activeX control executes outside of the browser, as a separate Windows process bound to the browser window.
Maybe when the page closes, the activeX control's process still executes (can be checked using the Windows task manager).
When the page reopens, it just re-binds to the extant process. At this point it then may be impossible to re-define the events handlers.
To overcome this, it might help to attach the event handler function() to the browser window; something like:
window.myHandler = function(){...};
control::event = window.myHandler;


I'm familiar with that post; the only thing that works is the SCRIPT FOR EVENT or the CONTROL::EVENT, I am using the latter. It works perfectly outside of FiC in a plain HTML page, but there I can use the FOR EVENT IE syntax. And in FiC it works the first time with the CONTROL::EVENT, but not subsequent times.


https://social.msdn.microsoft.com/Forums/ie/en-US/47eccb01-8089-4653-a0ce-45e9ced5e228/addeventlistener-for-activex-events-in-ie11?forum=iewebdevelopment

We've been experiencing the same issue. We use an ActiveX component to control machinery via COM port. As many of our customers have recently received IE 11 as an automatic update, we have been receiving reports that the tool no longer works as expected. The ActiveX component is quite obviously running, because the machinery is being controlled, but none of the events produced are being registered in the browser window, reglardless of whether `attachEvent` or `addEventListener` is used.

Fortunately, there is a simple work-around: force IE 10 emulation, by adding the following to the document's `<head>`:
<meta http-equiv="X-UA-Compatible" content="IE=10" />
and then use `attachEvent`, as before.

https://social.msdn.microsoft.com/Forums/ie/en-US/bb5db2d7-aa05-49a6-bfaf-b6f32913ae8e/correct-way-to-handle-custom-activex-events-in-javascript?forum=iewebdevelopment

note: foxInCloud operates in standard mode

Hi,

You haven't specified a DTD (document type declaration) so MSIE browsers see your page as Quirks, so yes <script for= is (and always has been) valid for use with Quirks Mode...

Other browsers treat no DTD as a Unknown DTD and use the most standards compliant mode (HTML 4)... they do not recognise it as the for and event attributes of the <script> tag are MS proprietary.

Issues will arrise if your migrate to a Standards DTD and use AddEventListener or AttachEvent..... these methods cumulatively add event handlers to an element, so you can have a number of method attached to an element event handler...

see
http://www.quirksmode.org/js/events_advanced.html
and
http://www.idocs.com/tags/scripts/_SCRIPT_FOR.html

The above recommend that you do not use it.....
You should be looking at migrating away from Quirks see http://msdn.microsoft.com/en-us/library/cc288325(v=VS.85).aspx
Rob^_^




Gravatar is a globally recognized avatar based on your email address. Re: new activeX issue
  Tuvia Vinitsky
  Thierry Nivelet (FoxInCloud)
  Aug 6, 2015 @ 06:30pm
You are right about the event handlers; MS has an article on how to properly destroy an AciveX - and concludes you cannot communicate fully with an ActiveX via IE, period. Nice.


The first reason I would think of: when the activeX is destroyed, its event handlers are still hanging around.
Prototype does a good job releasing the event handlers whenever an element is destroyed

I would try:

$('SigPlus1').observe('PenDown', sigPenDown); // or function(event){}

also the author of this post may help you:
http://stackoverflow.com/questions/10236040/how-to-access-topaz-signature-pad-activex-object-through-javascript


When I instantiate the <OBJECT> activeX it works fine. But if I "close" the form, which is a child form, and then open it again, it's mess. The object is still there, but it can no longer be communicated with. calling its method that just checks for its existence returns false.

And it is not enough to refresh, I have to actually stop and start the server.

Where do I go?


Gravatar is a globally recognized avatar based on your email address. Re: new activeX issue
  FoxInCloud Support - Thierry N.
  Tuvia Vinitsky
  Aug 6, 2015 @ 09:27pm
could you provide the URL?


You are right about the event handlers; MS has an article on how to properly destroy an AciveX - and concludes you cannot communicate fully with an ActiveX via IE, period. Nice.


The first reason I would think of: when the activeX is destroyed, its event handlers are still hanging around.
Prototype does a good job releasing the event handlers whenever an element is destroyed

I would try:

$('SigPlus1').observe('PenDown', sigPenDown); // or function(event){}

also the author of this post may help you:
http://stackoverflow.com/questions/10236040/how-to-access-topaz-signature-pad-activex-object-through-javascript


When I instantiate the <OBJECT> activeX it works fine. But if I "close" the form, which is a child form, and then open it again, it's mess. The object is still there, but it can no longer be communicated with. calling its method that just checks for its existence returns false.

And it is not enough to refresh, I have to actually stop and start the server.

Where do I go?




-- thn (FoxInCloud)

Gravatar is a globally recognized avatar based on your email address. Re: new activeX issue
  FoxInCloud Support - Thierry N.
  Tuvia Vinitsky
  Aug 6, 2015 @ 09:53pm
the Prototype error you have is normal - 'return' executes outside of a function(); you could wrap your code inside a self-executing function:
<script type="text/javascript">
(function(){
SigPlus1.ClearTablet();
SigPlus1.TabletState = 1; //Turns tablet on to collect signature
if(SigPlus1.TabletState == 0)
{
alert("Cannot locate signature pad! Please check that it is connected before continuing.");
SigPlus1.TabletComTest = false;
return 0;
}
})();
SigPlus1.LCDSetTabletMap(0, 240, 64, 100, 0, 1900, 700);

</script>

Went through the - awfully complex - topaz documentation;
from http://www.topazsystems.com/Software/download/sigweb.pdf I realized that this software could also be used in Chrome and FireFox, as a <canvas> rather than an activeX object - might be a way to work around your troubles, in such case getting support from topaz seems necessary.


This seems to definitely be related somehow to prototype etc.

I tried rather than calling a function in urt.js, I put the script in the form in wchtmlgen of an object. The code:

<script type="text/javascript">

SigPlus1.ClearTablet();
SigPlus1.TabletState = 1; //Turns tablet on to collect signature
if(SigPlus1.TabletState == 0)
{
alert("Cannot locate signature pad! Please check that it is connected before continuing.");
SigPlus1.TabletComTest = false;
return 0;
}
SigPlus1.LCDSetTabletMap(0, 240, 64, 100, 0, 1900, 700);

</script>


produces a prototype error at line 634
function evalScripts() {
return this.extractScripts().map(function(script) { return eval(script); });

ERROR: return statement outside of function.

The same code in urt.js but called from the objects wchtmlgen:

<script type="text/javascript">

sigSign();

</script>

works the first time the form is loaded. But if I "close" the form, it will not instantiate again. There are no error messages and stepping thru the code is no help, the code executes as it should but does not communicate with the device.

However if I just place the code in an HTML file and only include the JS scripts for the device, I have no problems at all. Like this works perfectly:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" charset="utf-8">
<head>
<script type="text/javascript" charset="utf-8" src="urtsig.js"></script>
<script type="text/javascript" charset="utf-8" src="SigWebTablet.js"></script>
</head>
<TABLE height=150 cellPadding=0 width=286 border=1 style="background-color:red" id="SigTable">
<TR>
<TD>
<OBJECT id=SigPlus1
style="WIDTH: 300px; HEIGHT: 150px" classid=clsid:69A40DA3-4D42-11D0-86B0-0000C025864A name=SigPlus1
VIEWASTEXT>
<PARAM NAME="_Version" VALUE="131095">
<PARAM NAME="_ExtentX" VALUE="4842">
<PARAM NAME="_ExtentY" VALUE="1323">
<PARAM NAME="_StockProps" VALUE="0">
</OBJECT>
</TD>
</TR>
</TABLE>

<script type="text/javascript">

function SigPlus1::PenDown()
{
// originally we used script type=javascript for=sigplus1 event=pendown (with correct case) and the FiC merge choked on it.
// this is the only other way to attach code to an activex custom method:
sigPenDown();
}
</script>
<script type="text/javascript">

sigSign();

</script>


I assume the activeX control executes outside of the browser, as a separate Windows process bound to the browser window.
Maybe when the page closes, the activeX control's process still executes (can be checked using the Windows task manager).
When the page reopens, it just re-binds to the extant process. At this point it then may be impossible to re-define the events handlers.
To overcome this, it might help to attach the event handler function() to the browser window; something like:
window.myHandler = function(){...};
control::event = window.myHandler;


I'm familiar with that post; the only thing that works is the SCRIPT FOR EVENT or the CONTROL::EVENT, I am using the latter. It works perfectly outside of FiC in a plain HTML page, but there I can use the FOR EVENT IE syntax. And in FiC it works the first time with the CONTROL::EVENT, but not subsequent times.


https://social.msdn.microsoft.com/Forums/ie/en-US/47eccb01-8089-4653-a0ce-45e9ced5e228/addeventlistener-for-activex-events-in-ie11?forum=iewebdevelopment

We've been experiencing the same issue. We use an ActiveX component to control machinery via COM port. As many of our customers have recently received IE 11 as an automatic update, we have been receiving reports that the tool no longer works as expected. The ActiveX component is quite obviously running, because the machinery is being controlled, but none of the events produced are being registered in the browser window, reglardless of whether `attachEvent` or `addEventListener` is used.

Fortunately, there is a simple work-around: force IE 10 emulation, by adding the following to the document's `<head>`:
<meta http-equiv="X-UA-Compatible" content="IE=10" />
and then use `attachEvent`, as before.

https://social.msdn.microsoft.com/Forums/ie/en-US/bb5db2d7-aa05-49a6-bfaf-b6f32913ae8e/correct-way-to-handle-custom-activex-events-in-javascript?forum=iewebdevelopment

note: foxInCloud operates in standard mode

Hi,

You haven't specified a DTD (document type declaration) so MSIE browsers see your page as Quirks, so yes <script for= is (and always has been) valid for use with Quirks Mode...

Other browsers treat no DTD as a Unknown DTD and use the most standards compliant mode (HTML 4)... they do not recognise it as the for and event attributes of the <script> tag are MS proprietary.

Issues will arrise if your migrate to a Standards DTD and use AddEventListener or AttachEvent..... these methods cumulatively add event handlers to an element, so you can have a number of method attached to an element event handler...

see
http://www.quirksmode.org/js/events_advanced.html
and
http://www.idocs.com/tags/scripts/_SCRIPT_FOR.html

The above recommend that you do not use it.....
You should be looking at migrating away from Quirks see http://msdn.microsoft.com/en-us/library/cc288325(v=VS.85).aspx
Rob^_^





Gravatar is a globally recognized avatar based on your email address. Re: new activeX issue
  Tuvia Vinitsky
  Thierry Nivelet (FoxInCloud)
  Aug 7, 2015 @ 06:17am

https://msdn.microsoft.com/en-us/library/ms537508.aspx


could you provide the URL?


You are right about the event handlers; MS has an article on how to properly destroy an AciveX - and concludes you cannot communicate fully with an ActiveX via IE, period. Nice.


The first reason I would think of: when the activeX is destroyed, its event handlers are still hanging around.
Prototype does a good job releasing the event handlers whenever an element is destroyed

I would try:

$('SigPlus1').observe('PenDown', sigPenDown); // or function(event){}

also the author of this post may help you:
http://stackoverflow.com/questions/10236040/how-to-access-topaz-signature-pad-activex-object-through-javascript


When I instantiate the <OBJECT> activeX it works fine. But if I "close" the form, which is a child form, and then open it again, it's mess. The object is still there, but it can no longer be communicated with. calling its method that just checks for its existence returns false.

And it is not enough to refresh, I have to actually stop and start the server.

Where do I go?




Gravatar is a globally recognized avatar based on your email address. Re: new activeX issue
  Tuvia Vinitsky
  Thierry Nivelet (FoxInCloud)
  Aug 7, 2015 @ 06:20am
Their newer "sigweb" api has pretty incomplete docs, I reached out to them and have tried to get their help, not much luck so far. I plan to keep trying.


the Prototype error you have is normal - 'return' executes outside of a function(); you could wrap your code inside a self-executing function:
<script type="text/javascript">
(function(){
SigPlus1.ClearTablet();
SigPlus1.TabletState = 1; //Turns tablet on to collect signature
if(SigPlus1.TabletState == 0)
{
alert("Cannot locate signature pad! Please check that it is connected before continuing.");
SigPlus1.TabletComTest = false;
return 0;
}
})();
SigPlus1.LCDSetTabletMap(0, 240, 64, 100, 0, 1900, 700);

</script>

Went through the - awfully complex - topaz documentation;
from http://www.topazsystems.com/Software/download/sigweb.pdf I realized that this software could also be used in Chrome and FireFox, as a <canvas> rather than an activeX object - might be a way to work around your troubles, in such case getting support from topaz seems necessary.


This seems to definitely be related somehow to prototype etc.

I tried rather than calling a function in urt.js, I put the script in the form in wchtmlgen of an object. The code:

<script type="text/javascript">

SigPlus1.ClearTablet();
SigPlus1.TabletState = 1; //Turns tablet on to collect signature
if(SigPlus1.TabletState == 0)
{
alert("Cannot locate signature pad! Please check that it is connected before continuing.");
SigPlus1.TabletComTest = false;
return 0;
}
SigPlus1.LCDSetTabletMap(0, 240, 64, 100, 0, 1900, 700);

</script>


produces a prototype error at line 634
function evalScripts() {
return this.extractScripts().map(function(script) { return eval(script); });

ERROR: return statement outside of function.

The same code in urt.js but called from the objects wchtmlgen:

<script type="text/javascript">

sigSign();

</script>

works the first time the form is loaded. But if I "close" the form, it will not instantiate again. There are no error messages and stepping thru the code is no help, the code executes as it should but does not communicate with the device.

However if I just place the code in an HTML file and only include the JS scripts for the device, I have no problems at all. Like this works perfectly:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" charset="utf-8">
<head>
<script type="text/javascript" charset="utf-8" src="urtsig.js"></script>
<script type="text/javascript" charset="utf-8" src="SigWebTablet.js"></script>
</head>
<TABLE height=150 cellPadding=0 width=286 border=1 style="background-color:red" id="SigTable">
<TR>
<TD>
<OBJECT id=SigPlus1
style="WIDTH: 300px; HEIGHT: 150px" classid=clsid:69A40DA3-4D42-11D0-86B0-0000C025864A name=SigPlus1
VIEWASTEXT>
<PARAM NAME="_Version" VALUE="131095">
<PARAM NAME="_ExtentX" VALUE="4842">
<PARAM NAME="_ExtentY" VALUE="1323">
<PARAM NAME="_StockProps" VALUE="0">
</OBJECT>
</TD>
</TR>
</TABLE>

<script type="text/javascript">

function SigPlus1::PenDown()
{
// originally we used script type=javascript for=sigplus1 event=pendown (with correct case) and the FiC merge choked on it.
// this is the only other way to attach code to an activex custom method:
sigPenDown();
}
</script>
<script type="text/javascript">

sigSign();

</script>


I assume the activeX control executes outside of the browser, as a separate Windows process bound to the browser window.
Maybe when the page closes, the activeX control's process still executes (can be checked using the Windows task manager).
When the page reopens, it just re-binds to the extant process. At this point it then may be impossible to re-define the events handlers.
To overcome this, it might help to attach the event handler function() to the browser window; something like:
window.myHandler = function(){...};
control::event = window.myHandler;


I'm familiar with that post; the only thing that works is the SCRIPT FOR EVENT or the CONTROL::EVENT, I am using the latter. It works perfectly outside of FiC in a plain HTML page, but there I can use the FOR EVENT IE syntax. And in FiC it works the first time with the CONTROL::EVENT, but not subsequent times.


https://social.msdn.microsoft.com/Forums/ie/en-US/47eccb01-8089-4653-a0ce-45e9ced5e228/addeventlistener-for-activex-events-in-ie11?forum=iewebdevelopment

We've been experiencing the same issue. We use an ActiveX component to control machinery via COM port. As many of our customers have recently received IE 11 as an automatic update, we have been receiving reports that the tool no longer works as expected. The ActiveX component is quite obviously running, because the machinery is being controlled, but none of the events produced are being registered in the browser window, reglardless of whether `attachEvent` or `addEventListener` is used.

Fortunately, there is a simple work-around: force IE 10 emulation, by adding the following to the document's `<head>`:
<meta http-equiv="X-UA-Compatible" content="IE=10" />
and then use `attachEvent`, as before.

https://social.msdn.microsoft.com/Forums/ie/en-US/bb5db2d7-aa05-49a6-bfaf-b6f32913ae8e/correct-way-to-handle-custom-activex-events-in-javascript?forum=iewebdevelopment

note: foxInCloud operates in standard mode

Hi,

You haven't specified a DTD (document type declaration) so MSIE browsers see your page as Quirks, so yes <script for= is (and always has been) valid for use with Quirks Mode...

Other browsers treat no DTD as a Unknown DTD and use the most standards compliant mode (HTML 4)... they do not recognise it as the for and event attributes of the <script> tag are MS proprietary.

Issues will arrise if your migrate to a Standards DTD and use AddEventListener or AttachEvent..... these methods cumulatively add event handlers to an element, so you can have a number of method attached to an element event handler...

see
http://www.quirksmode.org/js/events_advanced.html
and
http://www.idocs.com/tags/scripts/_SCRIPT_FOR.html

The above recommend that you do not use it.....
You should be looking at migrating away from Quirks see http://msdn.microsoft.com/en-us/library/cc288325(v=VS.85).aspx
Rob^_^






© 1996-2024