⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 newlibrary_intf.~pas

📁 学习DELPHI的remobject4 目前我正在学习
💻 ~PAS
字号:
unit NewLibrary_Intf;

{----------------------------------------------------------------------------}
{ This unit was automatically generated by the RemObjects SDK after reading  }
{ the RODL file associated with this project .                               }
{                                                                            }
{ Do not modify this unit manually, or your changes will be lost when this   }
{ unit is regenerated the next time you compile the project.                 }
{----------------------------------------------------------------------------}

interface

uses
  {vcl:} Classes, TypInfo,
  {RemObjects:} uROClasses, uROClient, uROTypes, uROClientIntf;

const
  { Library ID }
  LibraryUID = '{A0661DA9-FE17-4362-9705-32C94F87F94A}';

  { Service Interface ID's }
  INewService_IID : TGUID = '{3EC0FA33-3791-4748-8A90-C55C367F2953}';

  { Event ID's }

type
  { Forward declarations }
  INewService = interface;


  { INewService }
  INewService = interface
    ['{3EC0FA33-3791-4748-8A90-C55C367F2953}']
    function Sum(const A: Integer; const B: Integer): Integer;
    function GetServerTime: DateTime;
  end;

  { CoNewService }
  CoNewService = class
    class function Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): INewService;
  end;

  { TNewService_Proxy }
  TNewService_Proxy = class(TROProxy, INewService)
  protected
    function __GetInterfaceName:string; override;

    function Sum(const A: Integer; const B: Integer): Integer;
    function GetServerTime: DateTime;
  end;

implementation

uses
  {vcl:} SysUtils,
  {RemObjects:} uROEventRepository, uRORes;

{ CoNewService }

class function CoNewService.Create(const aMessage: IROMessage; aTransportChannel: IROTransportChannel): INewService;
begin
  result := TNewService_Proxy.Create(aMessage, aTransportChannel);
end;

{ TNewService_Proxy }

function TNewService_Proxy.__GetInterfaceName:string;
begin
  result := 'NewService';
end;

function TNewService_Proxy.Sum(const A: Integer; const B: Integer): Integer;
begin
  try
    __Message.InitializeRequestMessage(__TransportChannel, 'NewLibrary', __InterfaceName, 'Sum');
    __Message.Write('A', TypeInfo(Integer), A, []);
    __Message.Write('B', TypeInfo(Integer), B, []);
    __Message.Finalize;

    __TransportChannel.Dispatch(__Message);

    __Message.Read('Result', TypeInfo(Integer), result, []);
  finally
    __Message.FreeStream;
  end
end;

function TNewService_Proxy.GetServerTime: DateTime;
begin
  try
    __Message.InitializeRequestMessage(__TransportChannel, 'NewLibrary', __InterfaceName, 'GetServerTime');
    __Message.Finalize;

    __TransportChannel.Dispatch(__Message);

    __Message.Read('Result', TypeInfo(DateTime), result, [paIsDateTime]);
  finally
    __Message.FreeStream;
  end
end;

initialization
  RegisterProxyClass(INewService_IID, TNewService_Proxy);


finalization
  UnregisterProxyClass(INewService_IID);

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -