home *** CD-ROM | disk | FTP | other *** search
/ Chip 1999 March / Chip_1999-03_cd.bin / zkuste / delphi / INFO / DI9802TS.ZIP / Demo_TLB.pas < prev    next >
Pascal/Delphi Source File  |  1997-08-14  |  2KB  |  71 lines

  1. unit Demo_TLB;
  2.  
  3. { This file contains pascal declarations imported from a type library.
  4.   This file will be written during each import or refresh of the type
  5.   library editor.  Changes to this file will be discarded during the
  6.   refresh process. }
  7.  
  8. { Demo Library }
  9. { Version 1.0 }
  10.  
  11. interface
  12.  
  13. uses Windows, ActiveX, Classes, Graphics, OleCtrls, StdVCL;
  14.  
  15. const
  16.   LIBID_Demo: TGUID = '{10AD1EA0-FDEA-11D0-9D6A-00A02494592C}';
  17.  
  18. const
  19.  
  20. { Component class GUIDs }
  21.   Class_MyObj: TGUID = '{10AD1EA2-FDEA-11D0-9D6A-00A02494592C}';
  22.  
  23. type
  24.  
  25. { Forward declarations: Interfaces }
  26.   IMyObj = interface;
  27.   IMyObjDisp = dispinterface;
  28.  
  29. { Forward declarations: CoClasses }
  30.   MyObj = IMyObj;
  31.  
  32. { Dispatch interface for MyObj Object }
  33.  
  34.   IMyObj = interface(IDispatch)
  35.     ['{10AD1EA1-FDEA-11D0-9D6A-00A02494592C}']
  36.     procedure ShowCelcius(DegreesF: Integer); safecall;
  37.   end;
  38.  
  39. { DispInterface declaration for Dual Interface IMyObj }
  40.  
  41.   IMyObjDisp = dispinterface
  42.     ['{10AD1EA1-FDEA-11D0-9D6A-00A02494592C}']
  43.     procedure ShowCelcius(DegreesF: Integer); dispid 1;
  44.   end;
  45.  
  46. { MyObjObject }
  47.  
  48.   CoMyObj = class
  49.     class function Create: IMyObj;
  50.     class function CreateRemote(const MachineName: string): IMyObj;
  51.   end;
  52.  
  53.  
  54.  
  55. implementation
  56.  
  57. uses ComObj;
  58.  
  59. class function CoMyObj.Create: IMyObj;
  60. begin
  61.   Result := CreateComObject(Class_MyObj) as IMyObj;
  62. end;
  63.  
  64. class function CoMyObj.CreateRemote(const MachineName: string): IMyObj;
  65. begin
  66.   Result := CreateRemoteComObject(MachineName, Class_MyObj) as IMyObj;
  67. end;
  68.  
  69.  
  70. end.
  71.