I am trying to develop BHO to preview IE version 10. BHO should be able to enable javascript to call a C # function.
I followed the instructions below:
Calling BHO C # Methods from Javascript
These instructions work fine in IE 9.
Unfortunately, I found that they only work for the first tab created in IE 10. The second and subsequent tabs do not display the BHO interface for Javascript. Sometimes new tabs work, but most of the time they don't work. Moreover, he fails. I assume this has something to do with the process model, but then again, it works fine in IE 9 (which has the same process model).
Here is a specific piece of code that I am using:
private void InstallJSObject(IHTMLWindow2 window) { // Install our javascript object IExpando windowEx = (IExpando)window; PropertyInfo property = windowEx.GetProperty("myBHO", System.Reflection.BindingFlags.IgnoreCase); if (property == null) { property = windowEx.AddProperty("myBHO"); } property.SetValue(windowEx, this, null); }
Before publishing, I investigated the following: http://bit.ly/R9qldf
afourney
source share