新手求助,子窗口如何调用父窗口的方法
如题,本人delphi菜鸟,现在用delphi写了一个简易浏览器(被逼的),然后又因为要通过js和应用程序进行一些交互,因此做了一个扩展。
unit UMyExternal;interfaceuses Classes, ComObj, Article22_TLB,Windows, Messages, SysUtils, Variants, Graphics,Controls, Forms, Dialogs, OleCtrls, SHDocVw, ComCtrls, StdCtrls,IniFiles,ActiveX,MSHTML;type 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; procedure flashShow; safecall; procedure flashHide; safecall; procedure SetVideoOpen; safecall; public constructor Create; destructor Destroy; override; end;implementationuses StdActns;{ TMyExternal }procedure TMyExternal.SetVideoOpen;begin // 就是这里,我想让主窗口的一个控件显示出来,应该怎么做。。end;constructor TMyExternal.Create;var TypeLib: ITypeLib; // type library information ExeName: WideString; // name of our program's exe filebegin // Get name of application ExeName := ParamStr(0); // Load type library from application's resources OleCheck(LoadTypeLib(PWideChar(ExeName), TypeLib)); // Call inherited constructor inherited Create(TypeLib, IMyExternal); // Create and load string list from file fData := TStringList.Create; //fData.LoadFromFile(ChangeFileExt(ExeName, '.dat'));end;