我用BHO做了个COM,可是老出错,请高手指点!!!

lion_wing lion_wing 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我的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;
...全文

相关推荐

评论 3
收藏 已收藏
分享
返回顶部