AppServ2_TLB.pas
上传用户:fh681027
上传日期:2022-07-23
资源大小:1959k
文件大小:10k
源码类别:

Delphi控件源码

开发平台:

Delphi

  1. unit AppServ2_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:   1.81  $
  13. // File generated on 8/4/99 10:17:12 AM from Type Library described below.
  14. // *************************************************************************//
  15. // NOTE:                                                                      
  16. // Items guarded by $IFDEF_LIVE_SERVER_AT_DESIGN_TIME are used by properties  
  17. // which return objects that may need to be explicitly created via a function 
  18. // call prior to any access via the property. These items have been disabled  
  19. // in order to prevent accidental use from within the object inspector. You   
  20. // may enable them by defining LIVE_SERVER_AT_DESIGN_TIME or by selectively   
  21. // removing them from the $IFDEF blocks. However, such items must still be    
  22. // programmatically created via a method of the appropriate CoClass before    
  23. // they can be used.                                                          
  24. // ************************************************************************ //
  25. // Type Lib: C:md5codePart521AppServ2AppServ2.tlb (1)
  26. // IIDLCID: {C5DDE901-2214-11D1-98D0-444553540000}
  27. // Helpfile: 
  28. // DepndLst: 
  29. //   (1) v1.0 StdVCL, (C:WINDOWSSYSTEMSTDVCL32.DLL)
  30. //   (2) v1.0 stdole, (C:WINDOWSSYSTEMstdole32.tlb)
  31. //   (3) v2.0 StdType, (C:WINDOWSSYSTEMOLEPRO32.DLL)
  32. // ************************************************************************ //
  33. {$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers. 
  34. interface
  35. uses Windows, ActiveX, Classes, Graphics, OleServer, OleCtrls, StdVCL;
  36. // *********************************************************************//
  37. // GUIDS declared in the TypeLibrary. Following prefixes are used:        
  38. //   Type Libraries     : LIBID_xxxx                                      
  39. //   CoClasses          : CLASS_xxxx                                      
  40. //   DISPInterfaces     : DIID_xxxx                                       
  41. //   Non-DISP interfaces: IID_xxxx                                        
  42. // *********************************************************************//
  43. const
  44.   // TypeLibrary Major and minor versions
  45.   AppServ2MajorVersion = 1;
  46.   AppServ2MinorVersion = 0;
  47.   LIBID_AppServ2: TGUID = '{C5DDE901-2214-11D1-98D0-444553540000}';
  48.   IID_IRdmCount: TGUID = '{C5DDE902-2214-11D1-98D0-444553540000}';
  49.   CLASS_RdmCount: TGUID = '{C5DDE903-2214-11D1-98D0-444553540000}';
  50. type
  51. // *********************************************************************//
  52. // Forward declaration of types defined in TypeLibrary                    
  53. // *********************************************************************//
  54.   IRdmCount = interface;
  55.   IRdmCountDisp = dispinterface;
  56. // *********************************************************************//
  57. // Declaration of CoClasses defined in Type Library                       
  58. // (NOTE: Here we map each CoClass to its Default Interface)              
  59. // *********************************************************************//
  60.   RdmCount = IRdmCount;
  61. // *********************************************************************//
  62. // Interface: IRdmCount
  63. // Flags:     (4432) Hidden Dual OleAutomation Dispatchable
  64. // GUID:      {C5DDE902-2214-11D1-98D0-444553540000}
  65. // *********************************************************************//
  66.   IRdmCount = interface(IDataBroker)
  67.     ['{C5DDE902-2214-11D1-98D0-444553540000}']
  68.     function  Get_Table1: IProvider; safecall;
  69.     property Table1: IProvider read Get_Table1;
  70.   end;
  71. // *********************************************************************//
  72. // DispIntf:  IRdmCountDisp
  73. // Flags:     (4432) Hidden Dual OleAutomation Dispatchable
  74. // GUID:      {C5DDE902-2214-11D1-98D0-444553540000}
  75. // *********************************************************************//
  76.   IRdmCountDisp = dispinterface
  77.     ['{C5DDE902-2214-11D1-98D0-444553540000}']
  78.     property Table1: IProvider readonly dispid 1;
  79.     function  GetProviderNames: OleVariant; dispid 22929905;
  80.   end;
  81. // *********************************************************************//
  82. // The Class CoRdmCount provides a Create and CreateRemote method to          
  83. // create instances of the default interface IRdmCount exposed by              
  84. // the CoClass RdmCount. The functions are intended to be used by             
  85. // clients wishing to automate the CoClass objects exposed by the         
  86. // server of this typelibrary.                                            
  87. // *********************************************************************//
  88.   CoRdmCount = class
  89.     class function Create: IRdmCount;
  90.     class function CreateRemote(const MachineName: string): IRdmCount;
  91.   end;
  92. // *********************************************************************//
  93. // OLE Server Proxy class declaration
  94. // Server Object    : TRdmCount
  95. // Help String      : RdmCountObject
  96. // Default Interface: IRdmCount
  97. // Def. Intf. DISP? : No
  98. // Event   Interface: 
  99. // TypeFlags        : (2) CanCreate
  100. // *********************************************************************//
  101. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  102.   TRdmCountProperties= class;
  103. {$ENDIF}
  104.   TRdmCount = class(TOleServer)
  105.   private
  106.     FIntf:        IRdmCount;
  107. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  108.     FProps:       TRdmCountProperties;
  109.     function      GetServerProperties: TRdmCountProperties;
  110. {$ENDIF}
  111.     function      GetDefaultInterface: IRdmCount;
  112.   protected
  113.     procedure InitServerData; override;
  114.     function  Get_Table1: IProvider;
  115.   public
  116.     constructor Create(AOwner: TComponent); override;
  117.     destructor  Destroy; override;
  118.     procedure Connect; override;
  119.     procedure ConnectTo(svrIntf: IRdmCount);
  120.     procedure Disconnect; override;
  121.     function  GetProviderNames: OleVariant;
  122.     property  DefaultInterface: IRdmCount read GetDefaultInterface;
  123.     property Table1: IProvider read Get_Table1;
  124.   published
  125. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  126.     property Server: TRdmCountProperties read GetServerProperties;
  127. {$ENDIF}
  128.   end;
  129. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  130. // *********************************************************************//
  131. // OLE Server Properties Proxy Class
  132. // Server Object    : TRdmCount
  133. // (This object is used by the IDE's Property Inspector to allow editing
  134. //  of the properties of this server)
  135. // *********************************************************************//
  136.  TRdmCountProperties = class(TPersistent)
  137.   private
  138.     FServer:    TRdmCount;
  139.     function    GetDefaultInterface: IRdmCount;
  140.     constructor Create(AServer: TRdmCount);
  141.   protected
  142.     function  Get_Table1: IProvider;
  143.   public
  144.     property DefaultInterface: IRdmCount read GetDefaultInterface;
  145.   published
  146.   end;
  147. {$ENDIF}
  148. procedure Register;
  149. implementation
  150. uses ComObj;
  151. class function CoRdmCount.Create: IRdmCount;
  152. begin
  153.   Result := CreateComObject(CLASS_RdmCount) as IRdmCount;
  154. end;
  155. class function CoRdmCount.CreateRemote(const MachineName: string): IRdmCount;
  156. begin
  157.   Result := CreateRemoteComObject(MachineName, CLASS_RdmCount) as IRdmCount;
  158. end;
  159. procedure TRdmCount.InitServerData;
  160. const
  161.   CServerData: TServerData = (
  162.     ClassID:   '{C5DDE903-2214-11D1-98D0-444553540000}';
  163.     IntfIID:   '{C5DDE902-2214-11D1-98D0-444553540000}';
  164.     EventIID:  '';
  165.     LicenseKey: nil;
  166.     Version: 500);
  167. begin
  168.   ServerData := @CServerData;
  169. end;
  170. procedure TRdmCount.Connect;
  171. var
  172.   punk: IUnknown;
  173. begin
  174.   if FIntf = nil then
  175.   begin
  176.     punk := GetServer;
  177.     Fintf:= punk as IRdmCount;
  178.   end;
  179. end;
  180. procedure TRdmCount.ConnectTo(svrIntf: IRdmCount);
  181. begin
  182.   Disconnect;
  183.   FIntf := svrIntf;
  184. end;
  185. procedure TRdmCount.DisConnect;
  186. begin
  187.   if Fintf <> nil then
  188.   begin
  189.     FIntf := nil;
  190.   end;
  191. end;
  192. function TRdmCount.GetDefaultInterface: IRdmCount;
  193. begin
  194.   if FIntf = nil then
  195.     Connect;
  196.   Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
  197.   Result := FIntf;
  198. end;
  199. constructor TRdmCount.Create(AOwner: TComponent);
  200. begin
  201.   inherited Create(AOwner);
  202. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  203.   FProps := TRdmCountProperties.Create(Self);
  204. {$ENDIF}
  205. end;
  206. destructor TRdmCount.Destroy;
  207. begin
  208. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  209.   FProps.Free;
  210. {$ENDIF}
  211.   inherited Destroy;
  212. end;
  213. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  214. function TRdmCount.GetServerProperties: TRdmCountProperties;
  215. begin
  216.   Result := FProps;
  217. end;
  218. {$ENDIF}
  219. function  TRdmCount.Get_Table1: IProvider;
  220. begin
  221.   Result := DefaultInterface.Get_Table1;
  222. end;
  223. function  TRdmCount.GetProviderNames: OleVariant;
  224. begin
  225.   Result := DefaultInterface.GetProviderNames;
  226. end;
  227. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  228. constructor TRdmCountProperties.Create(AServer: TRdmCount);
  229. begin
  230.   inherited Create;
  231.   FServer := AServer;
  232. end;
  233. function TRdmCountProperties.GetDefaultInterface: IRdmCount;
  234. begin
  235.   Result := FServer.DefaultInterface;
  236. end;
  237. function  TRdmCountProperties.Get_Table1: IProvider;
  238. begin
  239.   Result := DefaultInterface.Get_Table1;
  240. end;
  241. {$ENDIF}
  242. procedure Register;
  243. begin
  244.   RegisterComponents('Servers',[TRdmCount]);
  245. end;
  246. end.