procedure TFrmCompanyInfo.FormCreate(Sender: TObject); begin inherited; AddEvent( procedure var aSysOptionArr:TSystemInfoArr; ISvr:IFcxsServer; begin CreateAnonymousThreadX(Self,Self, procedure (aThread:TAnonymousThreadX; aData:Pointer) function GetSysOptionStruct(iSvr:IFcxsServer;aSystemInfoEnum:TSystemInfoEnum ):TSystemInfoStruct; begin Result:=TSystemInfoStruct.Create; Result.aId:=aSystemInfoEnum; iSvr.GetSysOption(Result); end; begin aSysOptionArr:=TSystemInfoArr.Create; try ISvr:=CreateServerInterface(IFcxsServer_IID) as IFcxsServer; aSysOptionArr.Add(GetSysOptionStruct(ISvr, sieGsName)); aSysOptionArr.Add(GetSysOptionStruct(ISvr, sieGsPhone)); aSysOptionArr.Add(GetSysOptionStruct(ISvr, sieGsFaxNumber)); aSysOptionArr.Add(GetSysOptionStruct(ISvr, sidGsAddr)); aSysOptionArr.Add(GetSysOptionStruct(ISvr, sidGsManager)); aSysOptionArr.Add(GetSysOptionStruct(ISvr, sidBankAcount)); aThread.SetSyncPro( procedure function GetArrValue(aSystemInfoArr:TSystemInfoArr; aSystemInfoEnum:TSystemInfoEnum):string; var I:Integer; begin Result:=''; I:=aSystemInfoArr.GetIndex('aId',aSystemInfoEnum); if I > -1 then Result:=aSystemInfoArr.Items[I].aValue; end; begin with TFrmCompanyInfo(aData) do begin EditGsName.Text:=GetArrValue(aSysOptionArr,sieGsName); EditManager.Text:=GetArrValue(aSysOptionArr,sidGsManager); EditPhone.Text:=GetArrValue(aSysOptionArr,sieGsPhone); EditFax.Text:=GetArrValue(aSysOptionArr,sieGsFaxNumber); EditAddr.Text:=GetArrValue(aSysOptionArr,sidGsAddr); EditBankAcount.Text:=GetArrValue(aSysOptionArr,sidBankAcount); end; end ); finally aSysOptionArr.Free; end; end ); end ); end; 先是代码提示出错,再是乱出begin end,然后IDE非法操作,最后闪退~~~
----------------------------------------------
-