How To example: Run/Replace a script disconnect?

Add-in Express™ Support Service
That's what is more important than anything else

How To example: Run/Replace a script disconnect?
function done() { alert("hello"); } inserted, but doesn't fire ?? 
Robert Apostolico




Posts: 70
Joined: 2013-09-06
I downloaded and installed the sample "How to run and replace a script (JavaScript, JScript or VBScript) on an HTML page in Internet Explorer" from this page: http://www.add-in-express.com/support/ie-vbnet-csharp.php

Compiled/Registered ADX and it sort-of looks like it works.

However, there seems to be a disconnect between:
1. The "right-click view source" and F12 tools to inspect DOM.
The done() function doesn't appear in the source, but DOES appear in the DOM.

2. Clicking the Run script button results in an exception:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Runtime.InteropServices.COMException (0x80020101): Exception from HRESULT: 0x80020101
at mshtml.HTMLWindow2Class.IHTMLWindow2_execScript(String code, String language)
at MyIEAddon6.MyIEToolBar1.button1_Click(Object sender, EventArgs e) in c:\Test\ie\MyIEAddon6\MyIEToolBar1.cs:line 112
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18444 built by: FX451RTMGDR
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
MyIEAddon6
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Test/ie/MyIEAddon6/bin/Debug/MyIEAddon6.DLL
----------------------------------------
AddinExpress.IE
Assembly Version: 9.0.6121.0
Win32 Version: 9.0.6121.0
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/AddinExpress.IE/9.0.6121.0__4416dd98f0861965/AddinExpress.IE.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
Accessibility
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
Interop.SHDocVw
Assembly Version: 1.1.0.0
Win32 Version: 1.1.0.0
CodeBase: file:///C:/Test/ie/MyIEAddon6/bin/Debug/Interop.SHDocVw.DLL
----------------------------------------
Microsoft.mshtml
Assembly Version: 7.0.3300.0
Win32 Version: 7.0.3300.0
CodeBase: file:///C:/Windows/assembly/GAC/Microsoft.mshtml/7.0.3300.0__b03f5f7f11d50a3a/Microsoft.mshtml.dll
----------------------------------------
System.Runtime.Remoting
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Remoting/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

=-=-=-=-=-=-=-=

What am I doing wrong?

Please Advise.

Bob
BApostolico
Posted 02 May, 2014 11:58:30 Top
Andrei Smolin


Add-in Express team


Posts: 14137
Joined: 2006-05-11
Hello Bob,

Not sure about #1. As to #2, I suppose you've clicked the button while on a wrong page; the script wasn't found and you got the HRESULT. Is this the case?

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 06 May, 2014 07:37:13 Top
Robert Apostolico




Posts: 70
Joined: 2013-09-06
Andrei,

It might have been the case of IE 'going bad' ??

Today, the problem is not happening.

Thank you.
BApostolico
Posted 06 May, 2014 08:37:19 Top
Andrei Smolin


Add-in Express team


Posts: 14137
Joined: 2006-05-11
Who knows.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 07 May, 2014 01:00:05 Top