TiEmuOLELib_TLB.pas 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  1. unit TiEmuOLELib_TLB;
  2. // ************************************************************************ //
  3. // WARNING
  4. // -------
  5. // The types declared in this file were generated from data read from a
  6. // Type Library. If this type library is explicitly or indirectly (via
  7. // another type library referring to this type library) re-imported, or the
  8. // 'Refresh' command of the Type Library Editor activated while editing the
  9. // Type Library, the contents of this file will be regenerated and all
  10. // manual modifications will be lost.
  11. // ************************************************************************ //
  12. // PASTLWTR : $Revision$
  13. // File generated on 10/29/06 7:32:18 PM from Type Library described below.
  14. // ************************************************************************ //
  15. // Type Lib: G:\Delphi6\test\tiemu.tlb (1)
  16. // LIBID: {6140DC7C-3D74-41F9-A787-5946994AA8F2}
  17. // LCID: 0
  18. // Helpfile:
  19. // DepndLst:
  20. // (1) v2.0 stdole, (C:\WINDOWS\SYSTEM\STDOLE2.TLB)
  21. // (2) v4.0 StdVCL, (C:\WINDOWS\SYSTEM\stdvcl40.dll)
  22. // Errors:
  23. // Error creating palette bitmap of (TTiEmuOLE) : No Server registered for this CoClass
  24. // ************************************************************************ //
  25. // *************************************************************************//
  26. // NOTE:
  27. // Items guarded by $IFDEF_LIVE_SERVER_AT_DESIGN_TIME are used by properties
  28. // which return objects that may need to be explicitly created via a function
  29. // call prior to any access via the property. These items have been disabled
  30. // in order to prevent accidental use from within the object inspector. You
  31. // may enable them by defining LIVE_SERVER_AT_DESIGN_TIME or by selectively
  32. // removing them from the $IFDEF blocks. However, such items must still be
  33. // programmatically created via a method of the appropriate CoClass before
  34. // they can be used.
  35. {$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers.
  36. {$WARN SYMBOL_PLATFORM OFF}
  37. {$WRITEABLECONST ON}
  38. interface
  39. uses ActiveX, Classes, Graphics, OleServer, StdVCL, Variants, Windows;
  40. // *********************************************************************//
  41. // GUIDS declared in the TypeLibrary. Following prefixes are used:
  42. // Type Libraries : LIBID_xxxx
  43. // CoClasses : CLASS_xxxx
  44. // DISPInterfaces : DIID_xxxx
  45. // Non-DISP interfaces: IID_xxxx
  46. // *********************************************************************//
  47. const
  48. // TypeLibrary Major and minor versions
  49. TiEmuOLELibMajorVersion = 1;
  50. TiEmuOLELibMinorVersion = 0;
  51. LIBID_TiEmuOLELib: TGUID = '{6140DC7C-3D74-41F9-A787-5946994AA8F2}';
  52. IID_ITiEmuOLE: TGUID = '{E9373BD9-7363-427F-A2A6-1E8BA91FFB3E}';
  53. CLASS_TiEmuOLE: TGUID = '{B2A17B13-9D6F-4DD4-A2A9-6FE06ADC1D33}';
  54. type
  55. // *********************************************************************//
  56. // Forward declaration of types defined in TypeLibrary
  57. // *********************************************************************//
  58. ITiEmuOLE = interface;
  59. ITiEmuOLEDisp = dispinterface;
  60. // *********************************************************************//
  61. // Declaration of CoClasses defined in Type Library
  62. // (NOTE: Here we map each CoClass to its Default Interface)
  63. // *********************************************************************//
  64. TiEmuOLE = ITiEmuOLE;
  65. // *********************************************************************//
  66. // Interface: ITiEmuOLE
  67. // Flags: (4416) Dual OleAutomation Dispatchable
  68. // GUID: {E9373BD9-7363-427F-A2A6-1E8BA91FFB3E}
  69. // *********************************************************************//
  70. ITiEmuOLE = interface(IDispatch)
  71. ['{E9373BD9-7363-427F-A2A6-1E8BA91FFB3E}']
  72. function image_loaded: WordBool; safecall;
  73. function emulated_calc_type: SYSINT; safecall;
  74. function emulated_hw_version: SYSINT; safecall;
  75. function emulated_os_version: WideString; safecall;
  76. function ready_for_transfers: WordBool; safecall;
  77. function send_file(const filename: WideString): WordBool; safecall;
  78. function debug_file(const filename: WideString): WordBool; safecall;
  79. function reset_calc(clearmem: WordBool): WordBool; safecall;
  80. function execute_command(const command: WideString): WordBool; safecall;
  81. function turn_calc_on: WordBool; safecall;
  82. function enter_debugger: WordBool; safecall;
  83. end;
  84. // *********************************************************************//
  85. // DispIntf: ITiEmuOLEDisp
  86. // Flags: (4416) Dual OleAutomation Dispatchable
  87. // GUID: {E9373BD9-7363-427F-A2A6-1E8BA91FFB3E}
  88. // *********************************************************************//
  89. ITiEmuOLEDisp = dispinterface
  90. ['{E9373BD9-7363-427F-A2A6-1E8BA91FFB3E}']
  91. function image_loaded: WordBool; dispid 1610743808;
  92. function emulated_calc_type: SYSINT; dispid 1610743809;
  93. function emulated_hw_version: SYSINT; dispid 1610743810;
  94. function emulated_os_version: WideString; dispid 1610743811;
  95. function ready_for_transfers: WordBool; dispid 1610743812;
  96. function send_file(const filename: WideString): WordBool; dispid 1610743813;
  97. function debug_file(const filename: WideString): WordBool; dispid 1610743814;
  98. function reset_calc(clearmem: WordBool): WordBool; dispid 1610743815;
  99. function execute_command(const command: WideString): WordBool; dispid 1610743816;
  100. function turn_calc_on: WordBool; dispid 1610743817;
  101. function enter_debugger: WordBool; dispid 1610743818;
  102. end;
  103. // *********************************************************************//
  104. // The Class CoTiEmuOLE provides a Create and CreateRemote method to
  105. // create instances of the default interface ITiEmuOLE exposed by
  106. // the CoClass TiEmuOLE. The functions are intended to be used by
  107. // clients wishing to automate the CoClass objects exposed by the
  108. // server of this typelibrary.
  109. // *********************************************************************//
  110. CoTiEmuOLE = class
  111. class function Create: ITiEmuOLE;
  112. class function CreateRemote(const MachineName: string): ITiEmuOLE;
  113. end;
  114. // *********************************************************************//
  115. // OLE Server Proxy class declaration
  116. // Server Object : TTiEmuOLE
  117. // Help String : TiEmu OLE Interface Class
  118. // Default Interface: ITiEmuOLE
  119. // Def. Intf. DISP? : No
  120. // Event Interface:
  121. // TypeFlags : (2) CanCreate
  122. // *********************************************************************//
  123. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  124. TTiEmuOLEProperties= class;
  125. {$ENDIF}
  126. TTiEmuOLE = class(TOleServer)
  127. private
  128. FIntf: ITiEmuOLE;
  129. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  130. FProps: TTiEmuOLEProperties;
  131. function GetServerProperties: TTiEmuOLEProperties;
  132. {$ENDIF}
  133. function GetDefaultInterface: ITiEmuOLE;
  134. protected
  135. procedure InitServerData; override;
  136. public
  137. constructor Create(AOwner: TComponent); override;
  138. destructor Destroy; override;
  139. procedure Connect; override;
  140. procedure ConnectTo(svrIntf: ITiEmuOLE);
  141. procedure Disconnect; override;
  142. function image_loaded: WordBool;
  143. function emulated_calc_type: SYSINT;
  144. function emulated_hw_version: SYSINT;
  145. function emulated_os_version: WideString;
  146. function ready_for_transfers: WordBool;
  147. function send_file(const filename: WideString): WordBool;
  148. function debug_file(const filename: WideString): WordBool;
  149. function reset_calc(clearmem: WordBool): WordBool;
  150. function execute_command(const command: WideString): WordBool;
  151. function turn_calc_on: WordBool;
  152. function enter_debugger: WordBool;
  153. property DefaultInterface: ITiEmuOLE read GetDefaultInterface;
  154. published
  155. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  156. property Server: TTiEmuOLEProperties read GetServerProperties;
  157. {$ENDIF}
  158. end;
  159. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  160. // *********************************************************************//
  161. // OLE Server Properties Proxy Class
  162. // Server Object : TTiEmuOLE
  163. // (This object is used by the IDE's Property Inspector to allow editing
  164. // of the properties of this server)
  165. // *********************************************************************//
  166. TTiEmuOLEProperties = class(TPersistent)
  167. private
  168. FServer: TTiEmuOLE;
  169. function GetDefaultInterface: ITiEmuOLE;
  170. constructor Create(AServer: TTiEmuOLE);
  171. protected
  172. public
  173. property DefaultInterface: ITiEmuOLE read GetDefaultInterface;
  174. published
  175. end;
  176. {$ENDIF}
  177. procedure Register;
  178. resourcestring
  179. dtlServerPage = 'ActiveX';
  180. implementation
  181. uses ComObj;
  182. class function CoTiEmuOLE.Create: ITiEmuOLE;
  183. begin
  184. Result := CreateComObject(CLASS_TiEmuOLE) as ITiEmuOLE;
  185. end;
  186. class function CoTiEmuOLE.CreateRemote(const MachineName: string): ITiEmuOLE;
  187. begin
  188. Result := CreateRemoteComObject(MachineName, CLASS_TiEmuOLE) as ITiEmuOLE;
  189. end;
  190. procedure TTiEmuOLE.InitServerData;
  191. const
  192. CServerData: TServerData = (
  193. ClassID: '{B2A17B13-9D6F-4DD4-A2A9-6FE06ADC1D33}';
  194. IntfIID: '{E9373BD9-7363-427F-A2A6-1E8BA91FFB3E}';
  195. EventIID: '';
  196. LicenseKey: nil;
  197. Version: 500);
  198. begin
  199. ServerData := @CServerData;
  200. end;
  201. procedure TTiEmuOLE.Connect;
  202. var
  203. punk: IUnknown;
  204. begin
  205. if FIntf = nil then
  206. begin
  207. punk := GetServer;
  208. Fintf:= punk as ITiEmuOLE;
  209. end;
  210. end;
  211. procedure TTiEmuOLE.ConnectTo(svrIntf: ITiEmuOLE);
  212. begin
  213. Disconnect;
  214. FIntf := svrIntf;
  215. end;
  216. procedure TTiEmuOLE.DisConnect;
  217. begin
  218. if Fintf <> nil then
  219. begin
  220. FIntf := nil;
  221. end;
  222. end;
  223. function TTiEmuOLE.GetDefaultInterface: ITiEmuOLE;
  224. begin
  225. if FIntf = nil then
  226. Connect;
  227. Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
  228. Result := FIntf;
  229. end;
  230. constructor TTiEmuOLE.Create(AOwner: TComponent);
  231. begin
  232. inherited Create(AOwner);
  233. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  234. FProps := TTiEmuOLEProperties.Create(Self);
  235. {$ENDIF}
  236. end;
  237. destructor TTiEmuOLE.Destroy;
  238. begin
  239. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  240. FProps.Free;
  241. {$ENDIF}
  242. inherited Destroy;
  243. end;
  244. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  245. function TTiEmuOLE.GetServerProperties: TTiEmuOLEProperties;
  246. begin
  247. Result := FProps;
  248. end;
  249. {$ENDIF}
  250. function TTiEmuOLE.image_loaded: WordBool;
  251. begin
  252. Result := DefaultInterface.image_loaded;
  253. end;
  254. function TTiEmuOLE.emulated_calc_type: SYSINT;
  255. begin
  256. Result := DefaultInterface.emulated_calc_type;
  257. end;
  258. function TTiEmuOLE.emulated_hw_version: SYSINT;
  259. begin
  260. Result := DefaultInterface.emulated_hw_version;
  261. end;
  262. function TTiEmuOLE.emulated_os_version: WideString;
  263. begin
  264. Result := DefaultInterface.emulated_os_version;
  265. end;
  266. function TTiEmuOLE.ready_for_transfers: WordBool;
  267. begin
  268. Result := DefaultInterface.ready_for_transfers;
  269. end;
  270. function TTiEmuOLE.send_file(const filename: WideString): WordBool;
  271. begin
  272. Result := DefaultInterface.send_file(filename);
  273. end;
  274. function TTiEmuOLE.debug_file(const filename: WideString): WordBool;
  275. begin
  276. Result := DefaultInterface.debug_file(filename);
  277. end;
  278. function TTiEmuOLE.reset_calc(clearmem: WordBool): WordBool;
  279. begin
  280. Result := DefaultInterface.reset_calc(clearmem);
  281. end;
  282. function TTiEmuOLE.execute_command(const command: WideString): WordBool;
  283. begin
  284. Result := DefaultInterface.execute_command(command);
  285. end;
  286. function TTiEmuOLE.turn_calc_on: WordBool;
  287. begin
  288. Result := DefaultInterface.turn_calc_on;
  289. end;
  290. function TTiEmuOLE.enter_debugger: WordBool;
  291. begin
  292. Result := DefaultInterface.enter_debugger;
  293. end;
  294. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  295. constructor TTiEmuOLEProperties.Create(AServer: TTiEmuOLE);
  296. begin
  297. inherited Create;
  298. FServer := AServer;
  299. end;
  300. function TTiEmuOLEProperties.GetDefaultInterface: ITiEmuOLE;
  301. begin
  302. Result := FServer.DefaultInterface;
  303. end;
  304. {$ENDIF}
  305. procedure Register;
  306. begin
  307. RegisterComponents(dtlServerPage, [TTiEmuOLE]);
  308. end;
  309. end.