| 发表于:2007-01-16 17:39:023楼 得分:0 |
谢谢zuoansuifeng(左岸) 为什么会出undeclared identifier: 'iwebbrowser2 '的错误. 我的代码如 unit unit1; interface uses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, stdctrls,mshtml,activex; type tform1 = class(tform) button1: tbutton; private { private declarations } public { public declarations } function getframe(frameno:integer):iwebbrowser2; end; var form1: tform1; implementation {$r *.dfm} function tform1.getframe(frameno:integer):iwebbrowser2; var olecontainer:iolecontainer; enum:ienumunknown; unk:iunknown; fetched:plongint; begin while webbrowse1.readystate <> readystate_complete do application.processmessages; if assigned(webbrowse.document) then begin fetched:=nil; olecontainer:=webbrowse.document as iolecontainer; olecontainer.enumobjects(olecontf_embeddings,enum); enum.skip(frameno); enum.next(olecontf_embeddings,unk,fetched); result:=unk as iwebbrowser2; end else result:=nil; end; end. | | |
|