Componentes.Terceros.RemObj.../internal/5.0.23.613/1/RemObjects SDK for Delphi/Samples/Broadcast Chat/BroadcastChatService_Impl.pas
david 2824855ea7 - Modificación del paquete RemObjects_Core_D10 para que sea un paquete de runtime/designtime (antes era designtime sólo)
- Recompilación en Delphi10 de todos los paquetes de RO para generar las DCU's en Lib\D10
- Recompilación en Delphi10 de todos los paquetes de DA para generar las DCU's en Lib\D10

git-svn-id: https://192.168.0.254/svn/Componentes.Terceros.RemObjects@9 b6239004-a887-0f4b-9937-50029ccdca16
2007-09-10 14:06:19 +00:00

73 lines
2.2 KiB
ObjectPascal

unit BroadcastChatService_Impl;
{----------------------------------------------------------------------------}
{ This unit was automatically generated by the RemObjects SDK after reading }
{ the RODL file associated with this project . }
{ }
{ This is where you are supposed to code the implementation of your objects. }
{----------------------------------------------------------------------------}
interface
uses
{vcl:} Classes, SysUtils,
{RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions,
{Generated:} BroadcastChatLibrary_Intf;
type
{ TBroadcastChatService }
TBroadcastChatService = class(TRORemotable, IBroadcastChatService)
private
fSync_Date: TDateTime;
fSync_From, fSync_Message: string;
protected
{ IBroadcastChatService methods }
procedure SendMessage(const iDate: DateTime; const iFrom: string; const iMessage: string);
function GetInfo: string;
public
procedure MessageReceived;
end;
implementation
uses
{Generated:} BroadcastChatLibrary_Invk, BroadcastChatMain{$IFDEF VER140}, Windows, Messages{$ENDIF};
procedure Create_BroadcastChatService(out anInstance: IUnknown);
begin
anInstance := TBroadcastChatService.Create;
end;
{ BroadcastChatService }
procedure TBroadcastChatService.SendMessage(const iDate: DateTime; const iFrom: string; const iMessage: string);
begin
fSync_Date := iDate;
fSync_From := iFrom;
fSync_Message := iMessage;
{$IFDEF VER140}
Windows.SendMessage(BroadcastChatMainForm.Handle, WM_USER, Longint(Self), 0); // workaround for d6
{$ELSE}
Synchronize(MessageReceived);
{$ENDIF}
end;
function TBroadcastChatService.GetInfo: string;
begin
{ we'll just assume that this operation is trivial enough to be threadsafe ;-}
result := BroadcastChatMainForm.ed_NickName.Text;
end;
procedure TBroadcastChatService.MessageReceived;
begin
BroadcastChatMainForm.MessageReceived(fSync_Date, fSync_From, fSync_Message);
end;
initialization
TROClassFactory.Create('BroadcastChatService', Create_BroadcastChatService, TBroadcastChatService_Invoker);
finalization
end.