问题描述
我有一个用C ++编写的BHO,并安装在IE10上。
I have a BHO written in C++, and installed on IE10.
我有一个C#项目,通过自动化创建IE,如下所示:
I have a C# project which creates IE via automation like this:
SHDocVw.InternetExplorer IE = new SHDocVw.InternetExplorer();
IE.Visible = true;
IE.Visible = true;
IE.Navigate(" c:\\blah.htm");
IE.Navigate("c:\\blah.htm");
IWebBrowser2.Document doc = IE.Document;
IWebBrowser2.Document doc = IE.Document;
要使该文档有效,
$
To get that Document to work,
我想从这里访问BHO,所以我假设我可以这样做(比如在脚本中):
I want to access the BHO from here, so i assumed i could do this (like in script):
var myBHO = doc.window.external;
var myBHO = doc.window.external;
但它不能识别 文档对象上的"窗口"。
but it can't recognize 'window' on the document object.
如何通过此C#项目调用BHO上的方法?我是否必须在页面上编写javascript并调用它?我想把一个对象传递给BHO,所以我认为这不是正确的方法。
How can I call methods on my BHO from this C# project? Do I have to write javascript on the page and call it? I want to pass an object to the BHO though, so I don't think this is the right way to do it.
推荐答案
这篇关于如何从C#调用BHO上的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!