在TOleObj对象的方法中可以向所有已链接的客户程序触发事件OnBtnClick的源代码如下://枚举所有连接到服务器的活动链接function TOleObj.GetEnumerator: IEnumConnections;var Container: IConnectionPointContainer; ConnectionPoint: IConnectionPoint;begin OleCheck(QueryInterface(IConnectionPointContainer, Container)); OleCheck(Container.FindConnectionPoint(AutoFactory.EventIID, ConnectionPoint)); ConnectionPoint.EnumConnections(Result);end;//向所有客户程序发送事件procedure TOleObj.FireOnBtnClick(const Memo: WideString);var Enum: IEnumConnections; ConnectData: TConnectData; Fetched: Cardinal;begin Enum := GetEnumerator; if Enum <> nil then begin while Enum.Next(1, ConnectData, @Fetched) = S_OK do begin if ConnectData.pUnk <> nil then begin (ConnectData.pUnk as IOleObjEvents).OnBtnClick(Memo); end; end; end;end;问题就是上面两个方法如果搬到TFormMain中的话AutoFactory(TOleObj的属性)无法访问,郁闷。。。