Com接口,继承TAutoIntfObject如何实现,通过javascript控制form控件
通过webBrower加载的网页,控制窗体上的控件
用javascript来编写脚本
通过ActiveX和Com来实现
在C++Builder中,继承Interface不是很熟悉
请各位帮忙看看如下Delphi的代码怎么转成C++Builder的
TMyExternal = class(TAutoIntfObject, IMyExternal, IDispatch)
private
fData: TStringList; // info from data file
procedure ShowSBMsg(const Msg: string); // helper method
protected
{ IMyExternal methods }
function GetPrecis(const ProgID: WideString): WideString;
safecall;
procedure ShowURL(const ProgID: WideString); safecall;
procedure HideURL; safecall;
public
constructor Create;
destructor Destroy; override;
end;
[解决办法]
试着改了改,不保证全对啊
class TMyExternal:public TAutoIntfObject, IMyExternal, IDispatch{ private: TStringList *fData; ShowSBMsg(const String Msg); protected: __safecall WideString GetPrecis(const WideString ProgID); __safecall ShowURL(const WideString ProgID); __safecall void HideURL(); public: TMyExternal(); ~TMyExternal();};
[解决办法]