我在网上找了个关于IEBHO的代码,然后按照哪个设置了,后来运行的时候出现 [错误] Unit1.pas(15): Undeclared identifier: 'GetTypeInfoCount'
[错误] Unit1.pas(15): Undeclared identifier: 'GetTypeInfo'
[错误] Unit1.pas(15): Undeclared identifier: 'GetIDsOfNames'
[错误] Unit1.pas(15): Undeclared identifier: 'Invoke'
[警告] Unit1.pas(25): Text after final 'END.' - ignored by compiler
[致命错误] MYbho.dpr(6): Could not compile used unit 'Unit1.pas'
------代码贴出来看看--------------------------------
unit Unit1;{$WARN SYMBOL_PLATFORM OFF}interfaceuses
  Windows, ActiveX, Classes, ComObj, MYbho_TLB, StdVcl;type
  TMyIEBHO = class(TTypedComObject, IMyIEBHO)     protected
    {在这里声明 IMyIEBHO 方法}
  end;
implementationuses ComServ;initialization
  TTypedComObjectFactory.Create(ComServer, TMyIEBHO, Class_MyIEBHO,
    ciMultiInstance, tmApartment);
end.
   
       CPC.FindConnectionPoint(DWEBBrowserEvents2,CP);       CP.Advise(Self,Cookie);    //用Advise方法实现监听     end;   end;   Result:=S_OK;end;function TMyIEBHO.GetSite(const riid:TIID;out site:IUnknown):HResult;begin   if(Assigned(IEThis))then     Result:=IEThis.QueryInterface(riid,site)   else Result:=E_FAIL;end;
function TMyIEBHO.Invoke(DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var Params; VarResult, ExcepInfo, ArgErr: Pointer): HResult;type   POleVariant=^OleVariant;var   dps:TDispParams absolute Params;   bHasParams:Boolean;   pDispIDs:PDispIDList;   iDispIDsSize:Integer;begin   Result:=DISP_E_MEMBERNOTFOUND;   pDispIDs:=nil;   iDispIDsSize:=0;   bHasParams:=(dps.cArgs>0);   if(bHasParams)then   begin     iDispIDsSize:=dps.cArgs*SizeOf(TDispID);     GetMem(pDispIDs,iDispIDsSize);   end;   try     if(bHasParams)then BuildPositionalDispIDs(pDispIDs,dps);     case DispID of       104:begin           Result:=S_OK;         end;       250:begin           DoBeforeNavigate2(IDispatch(dps.rgvarg^[pDispIDs^[0]].dispVal),             POleVariant(dps.rgvarg^[pDispIDs^[1]].pvarVal)^,             POleVariant(dps.rgvarg^[pDispIDs^[2]].pvarVal)^,             POleVariant(dps.rgvarg^[pDispIDs^[3]].pvarVal)^,             POleVariant(dps.rgvarg^[pDispIDs^[4]].pvarVal)^,             POleVariant(dps.rgvarg^[pDispIDs^[5]].pvarVal)^,             dps.rgvarg^[pDispIDs^[6]].pbool^);           Result:=S_OK;         end;       253:begin           CP.Unadvise(Cookie);           Result:=S_OK;         end;     end;   finally     if(bHasParams)then       FreeMem(pDispIDs,iDispIDsSize);   end;end;
procedure DoBeforeNavigate2(const pDisp:IDispatch;var URL:OleVariant;var Flags:OleVariant;var TargetFrameName:OleVariant;var PostData:OleVariant; var Headers:OleVariant;var Cancel:WordBool);var   s:String;   URLFile:TextFile;begin     Assign(URLFile, 'c:\MyIEBHO.txt');     Reset(URLFile);     Try       while not Eof(URLFile) do         begin           ReadLn(URLFile, s);           if (Trim(URL)=Trim(s)) then             begin               Cancel:=True;               URL:='http://www.163.com';               (pDisp as   IWebbrowser2).Navigate2(URL,Flags,TargetFrameName,PostData,Headers);             end;         end;     Finally       Close(URLFile);     end;          end;
procedure TIEAdvBHOFactory.UpdateRegistry(Register: Boolean);begin   inherited;   if Register then     CreateRegKeyValue(HKEY_LOCAL_MACHINE, ,Software\Microsoft\Windows\CurrentVersion\explorer\Browser Helper Objects\’                        + GuidToString(ClassID), ’’, ’’)   else     DeleteRegKeyValue(HKEY_LOCAL_MACHINE, ,Software\Microsoft\Windows\CurrentVersion\explorer\Browser Helper Objects\’                        + GuidToString(ClassID), ’’);end;