home *** CD-ROM | disk | FTP | other *** search
/ Delphi Anthology / aDELPHI.iso / Runimage / Delphi50 / Demos / Corba / Account / accountclient.dpr < prev    next >
Text File  |  1999-08-11  |  842b  |  34 lines

  1. program AccountClient;
  2.  
  3. {$APPTYPE CONSOLE}
  4.  
  5. {
  6.   This Console CORBA Client is statically compiled with the Account's STUB Class
  7.   thereby using 'early binding'.
  8. }
  9.  
  10. uses
  11.   SysUtils,
  12.   Windows,
  13.   CorbaObj,
  14.   // The _TLB unit contains Client's STUB Class and Server's SKELETON Class
  15.   AccountServer_TLB in 'AccountServer_TLB.pas';
  16.  
  17. var
  18.   Account: IAccount;
  19.   InstanceName: String;
  20.   Bal: Double;
  21. begin
  22.   CorbaInitialize;
  23.   InstanceName := ParamStr(1);
  24.   if InstanceName = '' then InstanceName := 'Jack B. Quick';
  25.   try
  26.     Account := TAccountCorbaFactory.CreateInstance(InstanceName);
  27.     Bal := Account.Balance;
  28.     CharToOEM(PChar(InstanceName), PChar(InstanceName));
  29.     WriteLn(Format('The balance on %s''s account is $%f',[InstanceName, Bal]));
  30.   except
  31.     on E:Exception do WriteLn(E.Message);
  32.   end;
  33. end.
  34.