起步软件技术论坛-X3

 找回密码
 立即注册
搜索
查看: 350|回复: 4

【结贴】在message任务列表中启动功能时会出现如下图提示,请指教.

[复制链接]
发表于 2010-5-19 17:04:33 | 显示全部楼层 |阅读模式
在message任务列表中启动功能时会出现如下图提示,请指教.

未命名.jpg

7.77 KB, 下载次数: 194

回复

使用道具 举报

发表于 2010-5-19 17:11:33 | 显示全部楼层
messenger的版本与平台的资源不匹配了:
我把我这里系统初始化的源代码贴给你,你在里面找到所有 MainFormShowing 的都贴到你的里面试试:

{*******************************************************}
{                                                       }
{                  Business Init Func                   }
{                                                       }
{       Copyright (c) Justep Software Corporation       }
{                                                       }
{        业务运行平台初始化功能,系统的入口功能         }
{                                                       }
{*******************************************************}

unit INIT;

interface

uses
  System.Collections,
  Borland.Delphi.msxml,
  Business.System, Business.Data, Business.Model, Business.Forms,
  SystemCore, SystemUtils, ComponentsLib, AutoLogon, SettingLib;

type

  { TInit }

  TINIT = class(TFunc)
  private
    FLogoned: Boolean;
    FCMPlatform: TFunc;
    FMailSerForm: TFunc;
    FDocContentServiceFunc: TFunc;
    FDocServiceFunc: TFunc;
    FAddressListMessageReceiveFunc: TFunc;
    FCodeServerFunc: TFunc;

    FRunningClients: TRunningClients;

    FShutdown: TBusinessRuntimeServerMethod;
    FShow: TBusinessRuntimeServerMethod;
    FShowContent: TBusinessRuntimeServerMethod;
    FRegisterClient: TRegisgerClient;
    FUnregisterClient: TUnregisgerClient;
    FTouchClient: TTouchClient;
    FGetServerURL: TGetServerURL;
    FGetOperatorID: TGetOperatorID;
    FGetClientAccount: TGetClientAccount;
    FGetMainFormShowing: TGetMainFormShowing;

    FRunning: TRunning;
    FFuncs: array of TFunc;

    static function UseAD: Boolean;
    static function LoginUseAD: Boolean;

    static function InternalLogon(AParam: String): Boolean;

    { 以下方法由 Business 内部调用,不需要在其他任何地方调用,但可在其中加入需
      要在系统启动前初始化、系统退出之前释放的代码。 }
    static function Logon(const LogonID, Password: string): TOperator;
    static procedure Logoff;
    static procedure Init;
    static procedure Uninit;
  protected
    procedure DoRun; override;
    procedure DoTerminate; override;
  public
    constructor Create(AContext: TContext);
    destructor Destroy; override;

    { 系统初始化功能的实例 }
    static function InitInstance: TInit;
    { 提供给主界面注销用的方法 }
    static procedure LogoffByUser;

    procedure StartServer;
    procedure StopServer;

    property RunningClients: TRunningClients read FRunningClients;
  end;

  { TRunningClient }
  TRunningClient = class(TObject)
    LastActive: TDateTime;
    Timeout: Integer;
  end;

  { TRunningClients }
  TRunningClients = class
  private
    FItems: TStringList;
  public
    constructor Create;
    destructor Destroy; override;
    procedure Clear;

    function Find(const ID: string): TRunningClient;
    procedure Add(const ID: string; Timeout: Integer);
    procedure Remove(const ID: string);
    procedure Touch(const ID: string);
    procedure TouchOrAdd(const ID: string; Timeout: Integer);
  end;

implementation

type
  TCreateFunc = class(TBusinessRuntimeServerMethod)
    function GetName: string; override;
    function Invoke(var Params: array of object): object; override;
  end;

  { TRunning }
  TRunning = class(TBusinessRuntimeServerMethod)
    Running: Boolean;
    function GetName: string; override;
    function Invoke(var Params: array of object): object; override;
  end;

  { TShutdown }
  TShutdown = class(TBusinessRuntimeServerMethod)
    function GetName: string; override;
    function Invoke(var Params: array of object): object; override;
  end;

  { TShow }
  TShow = class(TBusinessRuntimeServerMethod)
    function GetName: string; override;
    function Invoke(var Params: array of object): object; override;
  end;

  { TShowContent }
  TShowContent = class(TBusinessRuntimeServerMethod)
    function GetName: string; override;
    function Invoke(var Params: array of object): object; override;
  end;

  { TRegisgerClient }
  TRegisgerClient = class(TBusinessRuntimeServerMethod)
    FRegister: TRunningClients;
    function GetName: string; override;
    function Invoke(var Params: array of object): object; override;
  end;

  { TUnregisgerClient }
  TUnregisgerClient = class(TBusinessRuntimeServerMethod)
    FRegister: TRunningClients;
    function GetName: string; override;
    function Invoke(var Params: array of object): object; override;
  end;

  { TTouchClient }
  TTouchClient = class(TBusinessRuntimeServerMethod)
    FRegister: TRunningClients;
    function GetName: string; override;
    function Invoke(var Params: array of object): object; override;
  end;

  { TGetServerURL }
  TGetServerURL = class(TBusinessRuntimeServerMethod)
    function GetName: string; override;
    function Invoke(var Params: array of object): object; override;
  end;

  { TGetOperatorID }
  TGetOperatorID = class(TBusinessRuntimeServerMethod)
    function GetName: string; override;
    function Invoke(var Params: array of object): object; override;
  end;

  { TGetClientAccount }
  TGetClientAccount = class(TBusinessRuntimeServerMethod)
    function GetName: string; override;
    function Invoke(var Params: array of object): object; override;
  end;

  { TGetMainFormShowing }
  TGetMainFormShowing = class(TBusinessRuntimeServerMethod)
    function GetName: string; override;
    function Invoke(var Params: array of object): object; override;
  end;

var
  FInitInstance: TInit;
  FInternalDisableAutoLogon: Boolean;
  CreateFunc: TCreateFunc;

{ TInit }

constructor TInit.Create(AContext: TContext);
begin
  if FInitInstance <> nil then
    raise Exception.Create('初始化功能已经创建');
  FInitInstance := Self;
  inherited;

  FRunningClients := TRunningClients.Create;

  FShutdown := TShutdown.Create;
  FShow := TShow.Create;
  FShowContent := TShowContent.Create;

  FRegisterClient := TRegisgerClient.Create;
  FRegisterClient.FRegister := FRunningClients;
  FUnregisterClient := TUnregisgerClient.Create;
  FUnregisterClient.FRegister := FRunningClients;
  FTouchClient := TTouchClient.Create;
  FTouchClient.FRegister := FRunningClients;

  FGetServerURL := TGetServerURL.Create;
  FGetOperatorID := TGetOperatorID.Create;

  FGetClientAccount := TGetClientAccount.Create;
  FGetMainFormShowing := TGetMainFormShowing.Create;

  FRunning := TRunning.Create;

  BizRtSrvr.BusinessRuntimeServer.RegisterMethod(FShutdown);
  BizRtSrvr.BusinessRuntimeServer.RegisterMethod(FShow);
  BizRtSrvr.BusinessRuntimeServer.RegisterMethod(FShowContent);

  BizRtSrvr.BusinessRuntimeServer.RegisterMethod(FRegisterClient);
  BizRtSrvr.BusinessRuntimeServer.RegisterMethod(FUnregisterClient);
  BizRtSrvr.BusinessRuntimeServer.RegisterMethod(FTouchClient);

  BizRtSrvr.BusinessRuntimeServer.RegisterMethod(FGetServerURL);
  BizRtSrvr.BusinessRuntimeServer.RegisterMethod(FGetOperatorID);

  BizRtSrvr.BusinessRuntimeServer.RegisterMethod(FRunning);

  BizRtSrvr.BusinessRuntimeServer.RegisterMethod(FGetClientAccount);

  BizRtSrvr.BusinessRuntimeServer.RegisterMethod(FGetMainFormShowing);

  StartServer;
end;

destructor TInit.Destroy;
begin
  FInitInstance := nil;

  StopServer;

  BizRtSrvr.BusinessRuntimeServer.UnregisterMethod(FGetMainFormShowing);

  BizRtSrvr.BusinessRuntimeServer.UnregisterMethod(FGetClientAccount);

  BizRtSrvr.BusinessRuntimeServer.UnregisterMethod(FRunning);

  BizRtSrvr.BusinessRuntimeServer.UnregisterMethod(FGetOperatorID);
  BizRtSrvr.BusinessRuntimeServer.UnregisterMethod(FGetServerURL);

  BizRtSrvr.BusinessRuntimeServer.UnregisterMethod(FRegisterClient);
  BizRtSrvr.BusinessRuntimeServer.UnregisterMethod(FUnregisterClient);
  BizRtSrvr.BusinessRuntimeServer.UnregisterMethod(FTouchClient);

  BizRtSrvr.BusinessRuntimeServer.UnregisterMethod(FShow);
  BizRtSrvr.BusinessRuntimeServer.UnregisterMethod(FShowContent);
  BizRtSrvr.BusinessRuntimeServer.UnregisterMethod(FShutdown);

  FGetClientAccount.Free;

  FRunning.Free;

  FGetOperatorID.Free;
  FGetServerURL.Free;

  FRegisterClient.Free;
  FUnregisterClient.Free;
  FTouchClient.Free;

  FShow.Free;
  FShowContent.Free;
  FShutdown.Free;

  inherited;
end;

static function TINIT.InitInstance: TInit;
begin
  Result := FInitInstance;
end;

static procedure TINIT.LogoffByUser;
var
  SaveInternalDisableAutoLogon: Boolean;
begin
  SaveInternalDisableAutoLogon := FInternalDisableAutoLogon;
  FInternalDisableAutoLogon := True;
  try
    TSystemCore.BeginWaiting;
    try
      Logoff;
      InitInstance.FLogoned := False;
    finally
      TSystemCore.EndWaiting;
    end;

    if TSystemCore.Operator = nil then
    begin
      if not InternalLogon('') then
      begin
        InitInstance.Terminate;
        Exit;
      end;
    end;
    InitInstance.FLogoned := True;

    TSystemCore.BeginWaiting;
    try
      InitInstance.MainForm := TSystemCore.SystemInterface.CreateMainForm(InitInstance.Context);
    finally
      TSystemCore.EndWaiting;
    end;
  finally
    FInternalDisableAutoLogon := SaveInternalDisableAutoLogon;
  end;
end;

static function TINIT.UseAD: Boolean;
begin
  Result := SysUtils.SameText(SysSrv.SysService.Config.Attributes('addomain/enabled', ''), 'true');
end;

static function TINIT.LoginUseAD: Boolean;
var
  I: Integer;
  o: object;
  disp: System.dispatchhelper;
  s, domain, pdc, username: string;
  person: Org.TPerson;
  domains: IXMLDOMNodeList;
  domainNode: IXMLDOMElement;
  pdcip: array of string;
begin
  Result := False;
  try
    o := ComObj.CreateOleObject('WinNTSystemInfo');
    try
      disp := TDispatchHelper.Create(o);
      domain := disp.PropertyGet('DomainName', []) as System.String;

      pdc := ''; // 去除警告
      username := ''; // 去除警告

      if domain = '' then
        Exit;

      pdc := disp.PropertyGet('PDC', []) as System.String;

      username := disp.PropertyGet('UserName', []) as System.String;
      if username = '' then
        Exit;
    finally
      (o as System.IDisposable).Dispose;
    end;

    domains := SysSrv.SysService.Config.Element.getElementsByTagName('domain');
    for I := 0 to domains.length - 1 do
    begin
      domainNode := domains.item[I] as IXMLDOMElement;
      s := ObjectHelper.ToString(domainNode.getAttribute('name'), '');
      if SysUtils.SameText(s, domain) then
      begin
        s := ObjectHelper.ToString(domainNode.getAttribute('pdcip'), '');
        if s <> '' then
        begin
          pdcip := s.Split([';', ',', ' ']);
          if not (pdcip as IList).Contains(jsSysUtils.GetComputerIPStr(pdc)) then
            Exit;
        end;

        s := ObjectHelper.ToString(domainNode.getAttribute('account'), domain);
        BizSys.BizSystem.ClientAccount := s;
        s := Opr.OperatorLoader.FindPersonID(username, '', False);
        if s = '' then
          Exit;

        person := Org.OrgSys.OrgSystem.FindPerson(s);

        if person = nil then
          Exit;

        Result := TSystemCore.Logon(person.ID, person.Password);

        Exit;
      end;
    end;
  except
  end;
end;

static function TINIT.InternalLogon(AParam: String): Boolean;
const
  MaxLogonFailCount = 3;
  LogonErrorMsg01 = '登录失败';
  LogonErrorMsg02 = '用户不存在或者密码错误,请注意大小写,密码是区分大小写的。';
  LogonErrorMsg03 = '对不起,您已经 %d 次登录失败,将退出系统。';
var
  I: Integer;
  lAccept: Boolean;
  sUser, sPass, lAccountID, lUserID, lMessage: String;
  lPerson: Org.TPerson;
  lLogonPerson: Org.TPersonMember;
begin
  if not FInternalDisableAutoLogon then
  begin
    if UseAD and LoginUseAD then
    begin
      Result := True;
      Exit;
    end;

    if AParam <> '' then
    begin
      lUserID := ''; // 去除警告
      lAccountID := ''; // 去除警告
      lMessage := ''; // 去除警告
      Result := TAutoLogon.AutoLogon(AParam, lUserID, lMessage, lAccountID);
      if not Result then
      begin
        Dialogs.MessageDlg(lMessage, TMsgDlgType.mtError, [TMsgDlgBtn.mbOK] , 0);
        Exit;
      end;
      BizSys.BizSystem.ClientAccount := lAccountID;
      if not SysUtils.SameText(lUserID, 'System') then
      begin
        lPerson := Org.OrgSys.OrgSystem.FindPerson(lUserID);
        Result := (not Opr.IsSystemManager(lUserID) or ExtUtils.ClientAccountExist(BizSys.BizSystem.ClientAccount)) and
              TSystemCore.Logon(lPerson.LoginID, lPerson.Password);
      end else begin
        Result := TSystemCore.Logon(lUserID, ExtUtils.ReadUserSysMngerPassWord);
      end;
      Exit;
    end
    else
      Result := False;
  end
  else
    Result := False;

  sUser := '';
  sPass := '';
  I := MaxLogonFailCount;
  repeat
    if I <> MaxLogonFailCount then
      Dialogs.MessageDlg(LogonErrorMsg02, TMsgDlgType.mtError, [TMsgDlgBtn.mbOK] , 0);

    { 旧调用模式
    lAccept := TSystemCore.SystemInterface.ShowLogonForm(sUser, sPass);}
    lAccept := TSystemCore.SystemInterface.ShowLogonFormEx(sUser, sPass, lLogonPerson);

    if not lAccept then Break;

    // IE嵌入登陆 sUser的返回可以为空(这个方案不好,为了做嵌入IE登陆)
    if sUser <>  '' then
    begin
      lAccountID := sUser;
      lUserID := JSCommon.SplitStr('@', lAccountID);
      BizSys.BizSystem.ClientAccount := lAccountID;

      Result := (not Opr.IsSystemManager(lUserID) or ExtUtils.ClientAccountExist(BizSys.BizSystem.ClientAccount)) and
        TSystemCore.LogonEx(lUserID, sPass, lLogonPerson);
    end
    else
      Result := True;

    if Result then Break;
    Dec(I);
  until I = 0;
  if not Result then
    if lAccept then
      Dialogs.MessageDlg(SysUtils.Format(LogonErrorMsg03, [MaxLogonFailCount]),
        TMsgDlgType.mtError, [TMsgDlgBtn.mbOK] , 0);
end;

procedure TINIT.DoRun;
var
  I: Integer;
  lContext: TContext;
  lOperator: TOperator;
  lClassURL: TBizClassURL;
  lServiceFuncs: TStrings;
begin
  TSystemCore.BeginWaiting;
  try
    inherited DoRun;

    //运行服务功能
    lServiceFuncs := TStringList.Create;
    try
      lServiceFuncs.Delimiter := ';';
      lServiceFuncs.QuoteChar := '''';
      lServiceFuncs.DelimitedText := TSettingLib.GetDefaultConfig.ServiceFuncs;
      SetLength(FFuncs, lServiceFuncs.Count);
      lClassURL := TBizClassURL.Create;
      try
        for I := 0 to lServiceFuncs.Count - 1 do
        begin
          lClassURL.BizURL.URL := lServiceFuncs[I];
          if BizSys.BizSystem.URLExists(lClassURL.BizURL) then
          begin
            FFuncs[I] := BizSys.BizService.CreateBizObject(lClassURL, Context) as TFunc;
            try
              FFuncs[I].Run('');
            except
            end;
          end
          else
            FFuncs[I] := nil;
        end;
      finally
        lClassURL.Free;
      end;
    finally
      lServiceFuncs.Free;
    end;

    lContext := Context.FindParentContext(BizSys.IL_PERSON);
    if lContext <> nil then
      lOperator := lContext.Owner as TOperator
    else
      lOperator := nil;

    if lOperator <> nil then
    begin
      TSystemCore.SetOperator(lOperator);
      TBizMessages.Notify(BizSys.GlobalContext, TBizMessages.LogonMessage, lOperator.Context);
      FLogoned := True;
    end;
  finally
    TSystemCore.EndWaiting;
  end;

  if not FLogoned then
  begin                     //SMP 200611219  Parameters
    FLogoned := InternalLogon('');
    if not FLogoned then
    begin
      Terminate;
      Exit;
    end;
  end;

  TSystemCore.BeginWaiting;
  try
    MainForm := TSystemCore.SystemInterface.CreateMainForm(Context);
  finally
    TSystemCore.EndWaiting;
  end;

  FRunning.Running := True;
  { 记录日志 }
  TSystemCore.AddSystemLog(TSystemCore.Operator.Context, 'SYSTEM', '登陆系统');
end;

procedure TINIT.DoTerminate;
var
I: Integer;
begin
  { 记录日志 }
  if TSystemCore.Operator <> nil then
    TSystemCore.AddSystemLog(TSystemCore.Operator.Context, 'SYSTEM', '退出系统');

  FRunning.Running := False;

  if MainForm <> nil then
  begin
    if MainForm.Visible then
      MainForm.Close;
    MainForm.ParentWindow := 0;
    MainForm.Release;
    MainForm := nil;
  end;

  TSystemCore.FuncManager.TerminateAllFuncs(True);

  // IE嵌入登陆 因为嵌入IE登陆的方案原因,导致这个代码难受
  // TSystemCore.OperatorSetted是判断是否是主动设置的操作者
  if FLogoned and (TSystemCore.Operator <> nil) and
    not TSystemCore.OperatorSetted then
    Logoff;

  {if FCMPlatform <> nil then
  begin
    FCMPlatform.Terminate;
    FCMPlatform.Free;
  end;

  if FMailSerForm <> nil then
  begin
    FMailSerForm.Terminate;
    FMailSerForm.Free;
  end;


  if FDocContentServiceFunc <> nil then
  begin
    FDocContentServiceFunc.Terminate;
    FDocContentServiceFunc.Free;
  end;

  if FDocServiceFunc <> nil then
  begin
    FDocServiceFunc.Terminate;
    FDocServiceFunc.Free;
  end;

  if FAddressListMessageReceiveFunc <> nil then
  begin
    FAddressListMessageReceiveFunc.Terminate;
    FAddressListMessageReceiveFunc.Free;
  end;

  if FCodeServerFunc <> nil then
  begin
    FCodeServerFunc.Terminate;
    FCodeServerFunc.Free;
  end; }

  for I := 0 to Length(FFuncs) - 1 do
  begin
    if FFuncs[I] <> nil then
    begin
      FFuncs[I].Terminate;
      FFuncs[I].Free;
    end;
  end;

  inherited;
end;

static function TINIT.Logon(const LogonID, Password: string): TOperator;
begin
  if TSystemCore.Logon(LogonID, Password) then
    Result := TSystemCore.Operator
  else
    Result := nil;
end;

static procedure TINIT.Logoff;
begin
  TSystemCore.Logoff;
end;

static procedure TINIT.Init;
begin
  // 速度优化增加,调试期间建议去除,可以方便发现错误
  BizDict.CheckTablePhysicalField := False;

  TSystemCore.Init;

  TComponentsLib.Init;

  TSettingLib.Init;

//  CommonComponentLibrary.TCommonComponentLibrary.Init; {兼容性保留}

  CreateFunc := TCreateFunc.Create;
  BizRtSrvr.BusinessRuntimeServer.RegisterMethod(CreateFunc);
end;

static procedure TINIT.Uninit;
var
  F: TForm;
begin
  if FInitInstance <> nil then
  begin
    TSystemCore.FuncManager.TerminateAllFuncs(True);

    F := FInitInstance.MainForm;
    FInitInstance.MainForm := nil;
    if F <> nil then
      F.Free;

    Forms.Application.ProcessMessages;
  end;

  BizRtSrvr.BusinessRuntimeServer.UnregisterMethod(CreateFunc);
  CreateFunc.Free;

//  CommonComponentLibrary.TCommonComponentLibrary.Uninit; {兼容性保留}

  TSettingLib.Uninit;

  TComponentsLib.Uninit;

  TSystemCore.Uninit;
end;

procedure TINIT.StartServer;
begin
  BizRtSrvr.BusinessRuntimeServer.Listener.AutoListen := True;
end;

procedure TINIT.StopServer;
begin
  BizRtSrvr.BusinessRuntimeServer.Listener.AutoListen := False;
  if BizRtSrvr.BusinessRuntimeServer.Listener.Listening then
    BizRtSrvr.BusinessRuntimeServer.Listener.Unlisten;
end;

{ TShutdown }
function TShutdown.GetName: string;
begin
  Result := 'Shutdown';
end;

function TShutdown.Invoke(var Params: array of object): object;
begin
  TInit.InitInstance.Terminate;
  Result := nil;
end;

{ TShow }
function TShow.GetName: string;
begin
  Result := 'Show';
end;

function TShow.Invoke(var Params: array of object): object;
begin
  if TInit.InitInstance.MainForm <> nil then
  begin
    TInit.InitInstance.MainForm.Show;
    Borland.Delphi.Windows.SetForegroundWindow(TInit.InitInstance.MainForm.Handle);
  end;
  Result := nil;
end;

{ TShowContent }
function TShowContent.GetName: string;
begin
  Result := 'ShowContent';
end;

function TShowContent.Invoke(var Params: array of object): object;
var
  S: string;
  lFunc: TFunc;
begin
  if Length(Params) = 0 then
  begin
    Result := nil;
    Exit;
  end;

  S := Params[0] as System.string;

  lFunc := TSystemCore.FuncManager.CreateFunc(TSystemCore.Operator.Context, 'Biz:\COLLABORATION\RUNNER_CONTENTURL.Func');
  try
    lFunc.Run(S);
  finally
    lFunc.Free;
  end;
  Result := nil;
end;

{ TRunningClients }
constructor TRunningClients.Create;
begin
  inherited;
  FItems := TStringList.Create;
  FItems.Sorted := True;
end;

destructor TRunningClients.Destroy;
begin
  Clear;
  FItems.Free;
  inherited;
end;

procedure TRunningClients.Clear;
var
  I: Integer;
begin
  for I := 0 to FItems.Count - 1 do
    FItems.Objects[I].Free;
  FItems.Clear;
end;

function TRunningClients.Find(const ID: string): TRunningClient;
var
  I: Integer;
begin
  I := FItems.IndexOf(ID);
  if I >= 0 then
  begin
    Result := FItems.Objects[I] as TRunningClient;
    if DateUtils.MilliSecondsBetween(SysUtils.Now, Result.LastActive) > Result.Timeout then
    begin
      FItems.Objects[I].Free;
      FItems.Delete(I);
      Result := nil;
    end;
  end
  else
    Result := nil;
end;

procedure TRunningClients.Add(const ID: string; Timeout: Integer);
var
  C: TRunningClient;
begin
  if Find(ID) <> nil then
    raise Exception.Create(ID + '已经注册');
  C := TRunningClient.Create;
  try
    C.LastActive := SysUtils.Now;
    C.Timeout := Timeout;
    FItems.AddObject(ID, C);
  except
    C.Free;
    raise;
  end;
end;

procedure TRunningClients.Remove(const ID: string);
var
  I: Integer;
begin
  I := FItems.IndexOf(ID);
  if I >= 0 then
  begin
    FItems.Objects[I].Free;
    FItems.Delete(I);
  end;
end;

procedure TRunningClients.Touch(const ID: string);
var
  C: TRunningClient;
begin
  C := Find(ID);
  if C = nil then
    raise Exception.Create(ID + '并没有注册');
  C.LastActive := SysUtils.Now;
end;

procedure TRunningClients.TouchOrAdd(const ID: string; Timeout: Integer);
var
  C: TRunningClient;
begin
  C := Find(ID);
  if C = nil then
    Add(ID, Timeout)
  else
    Touch(ID);
end;

{ TRegisgerClient }
function TRegisgerClient.GetName: string;
begin
  Result := 'RegisterClient';
end;

function TRegisgerClient.Invoke(var Params: array of object): object;
begin
  FRegister.Add(Params[0] as System.String, Integer(Params[1]));
  Result := nil;
end;

{ TUnregisgerClient }
function TUnregisgerClient.GetName: string;
begin
  Result := 'UnregisterClient';
end;

function TUnregisgerClient.Invoke(var Params: array of object): object;
begin
  FRegister.Remove(Params[0] as System.String);
  Result := nil;
end;

{ TTouchClient }
function TTouchClient.GetName: string;
begin
  Result := 'TouchClient';
end;

function TTouchClient.Invoke(var Params: array of object): object;
begin
  FRegister.TouchOrAdd(Params[0] as System.String, Integer(Params[1]));
  Result := nil;
end;

{ TGetOperatorID }
function TGetOperatorID.GetName: string;
begin
  Result := 'GetOperatorID';
end;

function TGetOperatorID.Invoke(var Params: array of object): object;
begin
  if TSystemCore.Operator = nil then
    Result := ''
  else
    Result := TSystemCore.Operator.ID;
end;

{ TGetServerURL }
function TGetServerURL.GetName: string;
begin
  Result := 'GetServerURL';
end;

function TGetServerURL.Invoke(var Params: array of object): object;
begin
  Result := SysSrv.SysService.ServerURL;
end;

{ TRunning }
function TRunning.GetName: string;
begin
  Result := 'Running';
end;

function TRunning.Invoke(var Params: array of object): object;
begin
  Result := Running;
end;

  { TGetClientAccount }
function TGetClientAccount.GetName: string;
begin
  Result := 'GetClientAccount';
end;

function TGetClientAccount.Invoke(var Params: array of object): object;
begin
  Result := BizSys.BizSystem.ClientAccount;
end;

{ TGetMainFormShowing }
function TGetMainFormShowing.GetName: string;
begin
  Result := 'GetMainFormShowing';
end;

function TGetMainFormShowing.Invoke(var Params: array of object): object;
begin
  Result := (TInit.InitInstance.MainForm  <> nil) and (TInit.InitInstance.MainForm.Showing);
end;

{ TCreateFunc }
function TCreateFunc.GetName: string;
begin
  Result := 'CreateFunc';
end;

function TCreateFunc.Invoke(var Params: array of object): object;
begin
  Result := TSystemCore.FuncManager.CreateFunc(BizSys.GlobalContext, System.String(Params[0]));
end;

end.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2010-5-22 16:55:20 | 显示全部楼层
你是打算让我来个全替换咋的?
回复 支持 反对

使用道具 举报

发表于 2010-5-22 21:59:15 | 显示全部楼层
不是的,是说 让你在2楼的代码中找到 MainFormShowing 的,然后在你的相同环境中加入,然后编译后再跑一下看看。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2010-5-23 10:16:59 | 显示全部楼层
搞定
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Justep Inc.

GMT+8, 2025-7-8 19:31 , Processed in 0.041013 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表