Module-script two-way interaction -- in C#

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

Module-script two-way interaction -- in C#
 
Todd Price




Posts: 14
Joined: 2014-08-13
The class is declared as follows:

[ComVisible(true), Guid("2C2B9139-2D96-4CAD-B4E6-08BA76F40E0A")] 
public class PageVault : AddinExpress.IE.ADXIEToolbarModule 


When I tried using BindingFlags.SetField, I get this exception:


System.ArgumentException: Must specify property Set or Get or method call for a COM Object.
Posted 15 Aug, 2014 10:11:11 Top
Todd Price




Posts: 14
Joined: 2014-08-13
The class is declared as follows:

[ComVisible(true), Guid("2C2B9139-2D96-4CAD-B4E6-08BA76F40E0A")]  
public class PageVault : AddinExpress.IE.ADXIEToolbarModule 


When I tried using BindingFlags.SetField, I get this exception:


System.ArgumentException: Must specify property Set or Get or method call for a COM Object.
Posted 15 Aug, 2014 10:12:58 Top
Andrei Smolin


Add-in Express team


Posts: 19112
Joined: 2006-05-11
Hi Todd,

Please see http://temp.add-in-express.com/support/module-script-two-way-interaction-cs.zip. Does it work for you?


Andrei Smolin
Add-in Express Team Leader
Posted 18 Aug, 2014 04:08:23 Top
Todd Price




Posts: 14
Joined: 2014-08-13
Andrei, thanks for your response, and sorry for my long delay in responding. I'm finally getting back to this.

I either am not following you here, or I can't get it to work. I can successfully register the add-in, but when I click the "Set Var in Script" menu item, I don't see any result. What I'm trying to do is:

1) Inject a long-running javascript into the page
2) Allow the script to run, perhaps for several minutes
3) When the script is done, issue a call at the end of the injected script which passes control back to the add-in (C#)

Is this possible?
Posted 19 Sep, 2014 09:24:48 Top
Andrei Smolin


Add-in Express team


Posts: 19112
Joined: 2006-05-11
Hi Todd,

Todd Price writes:
I can successfully register the add-in, but when I click the "Set Var in Script" menu item, I don't see any result.


Clicking that button sets a variable defined in the script, see the test page. When you click an HTML button on the page, the variable is tested and a method defined in your add-on gets invoked.

You can also debug that code to check if there's an exception.

If this still doesn't work:
Make sure that third-party add-ons are enabled. If enhanced protected mode is enabled, disable it.


Andrei Smolin
Add-in Express Team Leader
Posted 19 Sep, 2014 10:45:30 Top