我的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;