home *** CD-ROM | disk | FTP | other *** search
/ Delphi Anthology / aDELPHI.iso / Runimage / Delphi50 / Demos / Corba / Account / accountserverimpl.pas < prev   
Pascal/Delphi Source File  |  1999-08-11  |  666b  |  33 lines

  1. unit AccountServerImpl;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, ComObj, StdVcl,
  7.   CorbaObj, AccountServer_TLB;
  8.  
  9. type
  10.  
  11.   TAccount = class(TCorbaImplementation, IAccount)
  12.   private
  13.     { Private declarations }
  14.   public
  15.     { Public declarations }
  16.   protected
  17.     function Balance: Double; safecall;
  18.   end;
  19.  
  20. implementation
  21.  
  22. uses CorbInit;
  23.  
  24. function TAccount.Balance: Double;
  25. begin
  26.   Randomize;
  27.   Result := Random * 100;
  28. end;
  29.  
  30. initialization
  31.   TCorbaObjectFactory.Create('AccountFactory', 'Account', 'IDL:AccountServer/AccountFactory:1.0', IAccount,
  32.     TAccount, iMultiInstance, tmSingleThread);
  33. end.