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

Delphi控件源码

开发平台:

Delphi

  1. unit AppServTwo_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:21:04 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 Midas, (C:WINDOWSSYSTEMMIDAS.DLL)
  30. //   (2) v4.0 StdVCL, (C:WINDOWSSYSTEMSTDVCL40.DLL)
  31. //   (3) v2.0 stdole, (C:WINDOWSSYSTEMSTDOLE2.TLB)
  32. // ************************************************************************ //
  33. {$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers. 
  34. interface
  35. uses Windows, ActiveX, Classes, Graphics, OleServer, OleCtrls, StdVCL, 
  36.   Midas;
  37. // *********************************************************************//
  38. // GUIDS declared in the TypeLibrary. Following prefixes are used:        
  39. //   Type Libraries     : LIBID_xxxx                                      
  40. //   CoClasses          : CLASS_xxxx                                      
  41. //   DISPInterfaces     : DIID_xxxx                                       
  42. //   Non-DISP interfaces: IID_xxxx                                        
  43. // *********************************************************************//
  44. const
  45.   // TypeLibrary Major and minor versions
  46.   AppServTwoMajorVersion = 1;
  47.   AppServTwoMinorVersion = 0;
  48.   LIBID_AppServTwo: TGUID = '{C5DDE901-2214-11D1-98D0-444553540000}';
  49.   IID_IRdmCount: TGUID = '{C5DDE902-2214-11D1-98D0-444553540000}';
  50.   CLASS_RdmCount: TGUID = '{C5DDE903-2214-11D1-98D0-444553540000}';
  51. type
  52. // *********************************************************************//
  53. // Forward declaration of types defined in TypeLibrary                    
  54. // *********************************************************************//
  55.   IRdmCount = interface;
  56.   IRdmCountDisp = dispinterface;
  57. // *********************************************************************//
  58. // Declaration of CoClasses defined in Type Library                       
  59. // (NOTE: Here we map each CoClass to its Default Interface)              
  60. // *********************************************************************//
  61.   RdmCount = IRdmCount;
  62. // *********************************************************************//
  63. // Interface: IRdmCount
  64. // Flags:     (4432) Hidden Dual OleAutomation Dispatchable
  65. // GUID:      {C5DDE902-2214-11D1-98D0-444553540000}
  66. // *********************************************************************//
  67.   IRdmCount = interface(IAppServer)
  68.     ['{C5DDE902-2214-11D1-98D0-444553540000}']
  69.   end;
  70. // *********************************************************************//
  71. // DispIntf:  IRdmCountDisp
  72. // Flags:     (4432) Hidden Dual OleAutomation Dispatchable
  73. // GUID:      {C5DDE902-2214-11D1-98D0-444553540000}
  74. // *********************************************************************//
  75.   IRdmCountDisp = dispinterface
  76.     ['{C5DDE902-2214-11D1-98D0-444553540000}']
  77.     function  AS_ApplyUpdates(const ProviderName: WideString; Delta: OleVariant; 
  78.                               MaxErrors: Integer; out ErrorCount: Integer; var OwnerData: OleVariant): OleVariant; dispid 20000000;
  79.     function  AS_GetRecords(const ProviderName: WideString; Count: Integer; out RecsOut: Integer; 
  80.                             Options: Integer; const CommandText: WideString; 
  81.                             var Params: OleVariant; var OwnerData: OleVariant): OleVariant; dispid 20000001;
  82.     function  AS_DataRequest(const ProviderName: WideString; Data: OleVariant): OleVariant; dispid 20000002;
  83.     function  AS_GetProviderNames: OleVariant; dispid 20000003;
  84.     function  AS_GetParams(const ProviderName: WideString; var OwnerData: OleVariant): OleVariant; dispid 20000004;
  85.     function  AS_RowRequest(const ProviderName: WideString; Row: OleVariant; RequestType: Integer; 
  86.                             var OwnerData: OleVariant): OleVariant; dispid 20000005;
  87.     procedure AS_Execute(const ProviderName: WideString; const CommandText: WideString; 
  88.                          var Params: OleVariant; var OwnerData: OleVariant); dispid 20000006;
  89.   end;
  90. // *********************************************************************//
  91. // The Class CoRdmCount provides a Create and CreateRemote method to          
  92. // create instances of the default interface IRdmCount exposed by              
  93. // the CoClass RdmCount. The functions are intended to be used by             
  94. // clients wishing to automate the CoClass objects exposed by the         
  95. // server of this typelibrary.                                            
  96. // *********************************************************************//
  97.   CoRdmCount = class
  98.     class function Create: IRdmCount;
  99.     class function CreateRemote(const MachineName: string): IRdmCount;
  100.   end;
  101. // *********************************************************************//
  102. // OLE Server Proxy class declaration
  103. // Server Object    : TRdmCount
  104. // Help String      : RdmCountObject
  105. // Default Interface: IRdmCount
  106. // Def. Intf. DISP? : No
  107. // Event   Interface: 
  108. // TypeFlags        : (2) CanCreate
  109. // *********************************************************************//
  110. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  111.   TRdmCountProperties= class;
  112. {$ENDIF}
  113.   TRdmCount = class(TOleServer)
  114.   private
  115.     FIntf:        IRdmCount;
  116. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  117.     FProps:       TRdmCountProperties;
  118.     function      GetServerProperties: TRdmCountProperties;
  119. {$ENDIF}
  120.     function      GetDefaultInterface: IRdmCount;
  121.   protected
  122.     procedure InitServerData; override;
  123.   public
  124.     constructor Create(AOwner: TComponent); override;
  125.     destructor  Destroy; override;
  126.     procedure Connect; override;
  127.     procedure ConnectTo(svrIntf: IRdmCount);
  128.     procedure Disconnect; override;
  129.     function  AS_ApplyUpdates(const ProviderName: WideString; Delta: OleVariant; 
  130.                               MaxErrors: Integer; out ErrorCount: Integer; var OwnerData: OleVariant): OleVariant;
  131.     function  AS_GetRecords(const ProviderName: WideString; Count: Integer; out RecsOut: Integer; 
  132.                             Options: Integer; const CommandText: WideString; 
  133.                             var Params: OleVariant; var OwnerData: OleVariant): OleVariant;
  134.     function  AS_DataRequest(const ProviderName: WideString; Data: OleVariant): OleVariant;
  135.     function  AS_GetProviderNames: OleVariant;
  136.     function  AS_GetParams(const ProviderName: WideString; var OwnerData: OleVariant): OleVariant;
  137.     function  AS_RowRequest(const ProviderName: WideString; Row: OleVariant; RequestType: Integer; 
  138.                             var OwnerData: OleVariant): OleVariant;
  139.     procedure AS_Execute(const ProviderName: WideString; const CommandText: WideString; 
  140.                          var Params: OleVariant; var OwnerData: OleVariant);
  141.     property  DefaultInterface: IRdmCount read GetDefaultInterface;
  142.   published
  143. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  144.     property Server: TRdmCountProperties read GetServerProperties;
  145. {$ENDIF}
  146.   end;
  147. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  148. // *********************************************************************//
  149. // OLE Server Properties Proxy Class
  150. // Server Object    : TRdmCount
  151. // (This object is used by the IDE's Property Inspector to allow editing
  152. //  of the properties of this server)
  153. // *********************************************************************//
  154.  TRdmCountProperties = class(TPersistent)
  155.   private
  156.     FServer:    TRdmCount;
  157.     function    GetDefaultInterface: IRdmCount;
  158.     constructor Create(AServer: TRdmCount);
  159.   protected
  160.   public
  161.     property DefaultInterface: IRdmCount read GetDefaultInterface;
  162.   published
  163.   end;
  164. {$ENDIF}
  165. procedure Register;
  166. implementation
  167. uses ComObj;
  168. class function CoRdmCount.Create: IRdmCount;
  169. begin
  170.   Result := CreateComObject(CLASS_RdmCount) as IRdmCount;
  171. end;
  172. class function CoRdmCount.CreateRemote(const MachineName: string): IRdmCount;
  173. begin
  174.   Result := CreateRemoteComObject(MachineName, CLASS_RdmCount) as IRdmCount;
  175. end;
  176. procedure TRdmCount.InitServerData;
  177. const
  178.   CServerData: TServerData = (
  179.     ClassID:   '{C5DDE903-2214-11D1-98D0-444553540000}';
  180.     IntfIID:   '{C5DDE902-2214-11D1-98D0-444553540000}';
  181.     EventIID:  '';
  182.     LicenseKey: nil;
  183.     Version: 500);
  184. begin
  185.   ServerData := @CServerData;
  186. end;
  187. procedure TRdmCount.Connect;
  188. var
  189.   punk: IUnknown;
  190. begin
  191.   if FIntf = nil then
  192.   begin
  193.     punk := GetServer;
  194.     Fintf:= punk as IRdmCount;
  195.   end;
  196. end;
  197. procedure TRdmCount.ConnectTo(svrIntf: IRdmCount);
  198. begin
  199.   Disconnect;
  200.   FIntf := svrIntf;
  201. end;
  202. procedure TRdmCount.DisConnect;
  203. begin
  204.   if Fintf <> nil then
  205.   begin
  206.     FIntf := nil;
  207.   end;
  208. end;
  209. function TRdmCount.GetDefaultInterface: IRdmCount;
  210. begin
  211.   if FIntf = nil then
  212.     Connect;
  213.   Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
  214.   Result := FIntf;
  215. end;
  216. constructor TRdmCount.Create(AOwner: TComponent);
  217. begin
  218.   inherited Create(AOwner);
  219. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  220.   FProps := TRdmCountProperties.Create(Self);
  221. {$ENDIF}
  222. end;
  223. destructor TRdmCount.Destroy;
  224. begin
  225. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  226.   FProps.Free;
  227. {$ENDIF}
  228.   inherited Destroy;
  229. end;
  230. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  231. function TRdmCount.GetServerProperties: TRdmCountProperties;
  232. begin
  233.   Result := FProps;
  234. end;
  235. {$ENDIF}
  236. function  TRdmCount.AS_ApplyUpdates(const ProviderName: WideString; Delta: OleVariant; 
  237.                                     MaxErrors: Integer; out ErrorCount: Integer; 
  238.                                     var OwnerData: OleVariant): OleVariant;
  239. begin
  240.   Result := DefaultInterface.AS_ApplyUpdates(ProviderName, Delta, MaxErrors, ErrorCount, OwnerData);
  241. end;
  242. function  TRdmCount.AS_GetRecords(const ProviderName: WideString; Count: Integer; 
  243.                                   out RecsOut: Integer; Options: Integer; 
  244.                                   const CommandText: WideString; var Params: OleVariant; 
  245.                                   var OwnerData: OleVariant): OleVariant;
  246. begin
  247.   Result := DefaultInterface.AS_GetRecords(ProviderName, Count, RecsOut, Options, CommandText, 
  248.                                            Params, OwnerData);
  249. end;
  250. function  TRdmCount.AS_DataRequest(const ProviderName: WideString; Data: OleVariant): OleVariant;
  251. begin
  252.   Result := DefaultInterface.AS_DataRequest(ProviderName, Data);
  253. end;
  254. function  TRdmCount.AS_GetProviderNames: OleVariant;
  255. begin
  256.   Result := DefaultInterface.AS_GetProviderNames;
  257. end;
  258. function  TRdmCount.AS_GetParams(const ProviderName: WideString; var OwnerData: OleVariant): OleVariant;
  259. begin
  260.   Result := DefaultInterface.AS_GetParams(ProviderName, OwnerData);
  261. end;
  262. function  TRdmCount.AS_RowRequest(const ProviderName: WideString; Row: OleVariant; 
  263.                                   RequestType: Integer; var OwnerData: OleVariant): OleVariant;
  264. begin
  265.   Result := DefaultInterface.AS_RowRequest(ProviderName, Row, RequestType, OwnerData);
  266. end;
  267. procedure TRdmCount.AS_Execute(const ProviderName: WideString; const CommandText: WideString; 
  268.                                var Params: OleVariant; var OwnerData: OleVariant);
  269. begin
  270.   DefaultInterface.AS_Execute(ProviderName, CommandText, Params, OwnerData);
  271. end;
  272. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  273. constructor TRdmCountProperties.Create(AServer: TRdmCount);
  274. begin
  275.   inherited Create;
  276.   FServer := AServer;
  277. end;
  278. function TRdmCountProperties.GetDefaultInterface: IRdmCount;
  279. begin
  280.   Result := FServer.DefaultInterface;
  281. end;
  282. {$ENDIF}
  283. procedure Register;
  284. begin
  285.   RegisterComponents('Servers',[TRdmCount]);
  286. end;
  287. end.