com_serv_TLB.pas 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. unit com_serv_TLB;
  2. // part of Comtest demo from Anton K. mantis #35013
  3. // ************************************************************************ //
  4. // WARNING
  5. // -------
  6. // The types declared in this file were generated from data read from a
  7. // Type Library. If this type library is explicitly or indirectly (via
  8. // another type library referring to this type library) re-imported, or the
  9. // 'Refresh' command of the Type Library Editor activated while editing the
  10. // Type Library, the contents of this file will be regenerated and all
  11. // manual modifications will be lost.
  12. // ************************************************************************ //
  13. // PASTLWTR : 1.2
  14. // File generated on 16.08.2019 18:46:07 from Type Library described below.
  15. // ************************************************************************ //
  16. // Type Lib: com_serv.tlb (1)
  17. // LIBID: {4657B1E3-77D1-4504-A96C-3E79EF05721C}
  18. // LCID: 0
  19. // Helpfile:
  20. // HelpString: Project1 Library
  21. // DepndLst:
  22. // (1) v2.0 stdole, (C:\WINDOWS\system32\stdole2.tlb)
  23. // ************************************************************************ //
  24. {$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers.
  25. {$WARN SYMBOL_PLATFORM OFF}
  26. {$WRITEABLECONST ON}
  27. {$VARPROPSETTER ON}
  28. interface
  29. {$ifdef fpc}{$mode delphi}{$endif}
  30. uses Windows, ActiveX, Classes, Variants;
  31. // *********************************************************************//
  32. // GUIDS declared in the TypeLibrary. Following prefixes are used:
  33. // Type Libraries : LIBID_xxxx
  34. // CoClasses : CLASS_xxxx
  35. // DISPInterfaces : DIID_xxxx
  36. // Non-DISP interfaces: IID_xxxx
  37. // *********************************************************************//
  38. const
  39. // TypeLibrary Major and minor versions
  40. com_servMajorVersion = 1;
  41. com_servMinorVersion = 0;
  42. LIBID_com_serv: TGUID = '{4657B1E3-77D1-4504-A96C-3E79EF05721C}';
  43. IID_ITestApp: TGUID = '{1DD0AE6B-30C7-474E-8972-01981454B649}';
  44. CLASS_TestApp: TGUID = '{FD2054C2-4C67-47AE-A518-3FA6A7D691AA}';
  45. type
  46. // *********************************************************************//
  47. // Forward declaration of types defined in TypeLibrary
  48. // *********************************************************************//
  49. ITestApp = interface;
  50. ITestAppDisp = dispinterface;
  51. // *********************************************************************//
  52. // Declaration of CoClasses defined in Type Library
  53. // (NOTE: Here we map each CoClass to its Default Interface)
  54. // *********************************************************************//
  55. TestApp = ITestApp;
  56. // *********************************************************************//
  57. // Interface: ITestApp
  58. // Flags: (4416) Dual OleAutomation Dispatchable
  59. // GUID: {1DD0AE6B-30C7-474E-8972-01981454B649}
  60. // *********************************************************************//
  61. ITestApp = interface(IDispatch)
  62. ['{1DD0AE6B-30C7-474E-8972-01981454B649}']
  63. procedure test(const text: WideString); safecall;
  64. procedure test_ret(var res: OleVariant); safecall;
  65. end;
  66. // *********************************************************************//
  67. // DispIntf: ITestAppDisp
  68. // Flags: (4416) Dual OleAutomation Dispatchable
  69. // GUID: {1DD0AE6B-30C7-474E-8972-01981454B649}
  70. // *********************************************************************//
  71. ITestAppDisp = dispinterface
  72. ['{1DD0AE6B-30C7-474E-8972-01981454B649}']
  73. procedure test(const text: WideString); dispid 201;
  74. procedure test_ret(var res: OleVariant); dispid 202;
  75. end;
  76. // *********************************************************************//
  77. // The Class CoTestApp provides a Create and CreateRemote method to
  78. // create instances of the default interface ITestApp exposed by
  79. // the CoClass TestApp. The functions are intended to be used by
  80. // clients wishing to automate the CoClass objects exposed by the
  81. // server of this typelibrary.
  82. // *********************************************************************//
  83. CoTestApp = class
  84. class function Create: ITestApp;
  85. class function CreateRemote(const MachineName: string): ITestApp;
  86. end;
  87. implementation
  88. uses ComObj;
  89. class function CoTestApp.Create: ITestApp;
  90. begin
  91. Result := CreateComObject(CLASS_TestApp) as ITestApp;
  92. end;
  93. class function CoTestApp.CreateRemote(const MachineName: string): ITestApp;
  94. begin
  95. Result := CreateRemoteComObject(MachineName, CLASS_TestApp) as ITestApp;
  96. end;
  97. end.