twebBrowser中响应html的事件
怎样让HTML中的元素调用delphi中的方法
谢谢~
[解决办法]
Html中Java脚本调用COM接口
WebBrowser 有一个OnGetExternal事件,在这里实现: wbBrowser.OnGetExternal := OnGetExternal;...function TfrmBrowser.OnGetExternal(out ppDispatch: IDispatch): HRESULT;var FIntf: TWebBrowserEvent;begin FIntf := TWebBrowserEvent.Create; ppDispatch := FIntf; Result := S_OK;end;.../// Com Objectuses ComObj, ActiveX, BrowserEx_TLB, StdVcl;type TWebBrowserEvent = class(TAutoObject, ISomeIntface) protected procedure Test; safecall; function Get_GetMacAddr: OleVariant; safecall; // do something, implement ISomeIntface end