我用BHO做了个COM,可是老出错,请高手指点!!!
我的BHO做使用了shdocvw,mshtml类型库
本来没有 IETest:=pUnkSite as IWebbrowser2;
IH:=IETest.document as ihtmldocument2;
这两句运行无误,可加上后出现错:Project IEXPLORE.exe raised exception class EOleException with message '未指定的错误'.Process stopped.UseStep or Run to continue.
请指教!!分不够可以再加!!!!
代码如下:
function TIEBrowserHelper.SetSite(const pUnkSite: IUnknown): HResult;
var
CPC: IConnectionPointContainer;
IETest:IWebbrowser2;
IH:IHTMLDocument2;
begin
if Assigned(pUnkSite) then
begin
IETest:=pUnkSite as IWebbrowser2;//有问题???
IH:=IETest.document as ihtmldocument2;;//有问题???
IE := pUnkSite as IWebbrowser2;
CPC := IE as IConnectionPointContainer;
CPC.FindConnectionPoint(DWebBrowserEvents2, CP);
CP.Advise(Self, Cookie);
if Helperform = nil then
begin
HelperForm := THelperForm.Create(nil);
HelperForm.Visible := True;
end;
end;
Result := S_OK
end;
本来没有 IETest:=pUnkSite as IWebbrowser2;
IH:=IETest.document as ihtmldocument2;
这两句运行无误,可加上后出现错:Project IEXPLORE.exe raised exception class EOleException with message '未指定的错误'.Process stopped.UseStep or Run to continue.
请指教!!分不够可以再加!!!!
代码如下:
function TIEBrowserHelper.SetSite(const pUnkSite: IUnknown): HResult;
var
CPC: IConnectionPointContainer;
IETest:IWebbrowser2;
IH:IHTMLDocument2;
begin
if Assigned(pUnkSite) then
begin
IETest:=pUnkSite as IWebbrowser2;//有问题???
IH:=IETest.document as ihtmldocument2;;//有问题???
IE := pUnkSite as IWebbrowser2;
CPC := IE as IConnectionPointContainer;
CPC.FindConnectionPoint(DWebBrowserEvents2, CP);
CP.Advise(Self, Cookie);
if Helperform = nil then
begin
HelperForm := THelperForm.Create(nil);
HelperForm.Visible := True;
end;
end;
Result := S_OK
end;
...全文
相关推荐
c++ BHO实例源码及开发教程
### 四、BHO实例源码分析在提供的压缩包中,"www.pudn.com.txt"可能包含了关于BHO开发的详细文档,而"IEBrower"可能是BHO的源代码。
BHO.zip_BHO_bho CSharp_csharp bho_site:www.pudn.com_劫持
详细讲解BHO的开发,首先需要理解COM(Component Object Model)组件模型,因为BHO是基于COM构建的。
Delphi BHO
在Delphi编程环境中,开发BHO同样非常方便,因为Delphi支持COM(Component Object Model)编程,这是创建BHO所必需的技术。
bho.zip_BHO
开发BHO涉及的关键知识点包括:- **COM(Component Object Model)**:BHO是基于COM架构的,它定义了一种组件间通信的标准。
bho.rar_BHO_BHO_HelloWorld.r_bho CSharp_bho c_csharp bho
开发C# BHO的步骤大致如下:1. 创建COM类:首先,你需要定义一个实现了`IDispatch`接口的COM类。这个接口使得BHO可以与JavaScript或其他脚本语言交互。2.


网络通信/分布式开发
