home *** CD-ROM | disk | FTP | other *** search
/ Delphi Anthology / aDELPHI.iso / Runimage / Delphi50 / Demos / Midas / InternetExpress / CustomerList / rdmcustomerdata_tlb.pas < prev    next >
Pascal/Delphi Source File  |  1999-08-11  |  19KB  |  377 lines

  1. unit rdmCustomerData_TLB;
  2.  
  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.  
  14. // PASTLWTR : $Revision:   1.79  $
  15. // File generated on 6/30/99 3:49:26 PM from Type Library described below.
  16.  
  17. // ************************************************************************ //
  18. // Type Lib: E:\ngdemo\rdmCustomerData.tlb (1)
  19. // IID\LCID: {930FAEE0-0DC1-11D3-AA8A-00A024C11562}\0
  20. // Helpfile: 
  21. // DepndLst: 
  22. //   (1) v1.0 Midas, (E:\tp\bin\midas.dll)
  23. //   (2) v2.0 stdole, (C:\WINNT\System32\STDOLE2.TLB)
  24. //   (3) v4.0 StdVCL, (C:\WINNT\System32\STDVCL40.DLL)
  25. // ************************************************************************ //
  26. interface
  27.  
  28. uses Windows, ActiveX, Classes, Graphics, OleServer, OleCtrls, StdVCL, 
  29.   MIDAS;
  30.  
  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.   rdmCustomerDataMajorVersion = 1;
  41.   rdmCustomerDataMinorVersion = 0;
  42.  
  43.   LIBID_rdmCustomerData: TGUID = '{930FAEE0-0DC1-11D3-AA8A-00A024C11562}';
  44.  
  45.   IID_ICustomerData: TGUID = '{930FAEE1-0DC1-11D3-AA8A-00A024C11562}';
  46.   CLASS_CustomerData: TGUID = '{930FAEE3-0DC1-11D3-AA8A-00A024C11562}';
  47. type
  48.  
  49. // *********************************************************************//
  50. // Forward declaration of types defined in TypeLibrary                    
  51. // *********************************************************************//
  52.   ICustomerData = interface;
  53.   ICustomerDataDisp = dispinterface;
  54.  
  55. // *********************************************************************//
  56. // Declaration of CoClasses defined in Type Library                       
  57. // (NOTE: Here we map each CoClass to its Default Interface)              
  58. // *********************************************************************//
  59.   CustomerData = ICustomerData;
  60.  
  61.  
  62. // *********************************************************************//
  63. // Interface: ICustomerData
  64. // Flags:     (4416) Dual OleAutomation Dispatchable
  65. // GUID:      {930FAEE1-0DC1-11D3-AA8A-00A024C11562}
  66. // *********************************************************************//
  67.   ICustomerData = interface(IAppServer)
  68.     ['{930FAEE1-0DC1-11D3-AA8A-00A024C11562}']
  69.   end;
  70.  
  71. // *********************************************************************//
  72. // DispIntf:  ICustomerDataDisp
  73. // Flags:     (4416) Dual OleAutomation Dispatchable
  74. // GUID:      {930FAEE1-0DC1-11D3-AA8A-00A024C11562}
  75. // *********************************************************************//
  76.   ICustomerDataDisp = dispinterface
  77.     ['{930FAEE1-0DC1-11D3-AA8A-00A024C11562}']
  78.     function  AS_ApplyUpdates {Flags(2), (6/5) CC:0, INV:1, DBG:4}(const ProviderName: {VT_8:0}WideString; 
  79.                                                                    Delta: {VT_12:0}OleVariant; 
  80.                                                                    MaxErrors: {VT_3:0}Integer; 
  81.                                                                    out ErrorCount: {VT_3:1}Integer; 
  82.                                                                    var OwnerData: {VT_12:1}OleVariant): OleVariant; dispid 20000000;
  83.     function  AS_GetRecords {Flags(2), (8/7) CC:0, INV:1, DBG:4}(const ProviderName: {VT_8:0}WideString; 
  84.                                                                  Count: {VT_3:0}Integer; 
  85.                                                                  out RecsOut: {VT_3:1}Integer; 
  86.                                                                  Options: {VT_3:0}Integer; 
  87.                                                                  const CommandText: {VT_8:0}WideString; 
  88.                                                                  var Params: {VT_12:1}OleVariant; 
  89.                                                                  var OwnerData: {VT_12:1}OleVariant): OleVariant; dispid 20000001;
  90.     function  AS_DataRequest {Flags(2), (3/2) CC:0, INV:1, DBG:4}(const ProviderName: {VT_8:0}WideString; 
  91.                                                                   Data: {VT_12:0}OleVariant): OleVariant; dispid 20000002;
  92.     function  AS_GetProviderNames {Flags(2), (1/0) CC:0, INV:1, DBG:4}: OleVariant; dispid 20000003;
  93.     function  AS_GetParams {Flags(2), (3/2) CC:0, INV:1, DBG:4}(const ProviderName: {VT_8:0}WideString; 
  94.                                                                 var OwnerData: {VT_12:1}OleVariant): OleVariant; dispid 20000004;
  95.     function  AS_RowRequest {Flags(2), (5/4) CC:0, INV:1, DBG:4}(const ProviderName: {VT_8:0}WideString; 
  96.                                                                  Row: {VT_12:0}OleVariant; 
  97.                                                                  RequestType: {VT_3:0}Integer; 
  98.                                                                  var OwnerData: {VT_12:1}OleVariant): OleVariant; dispid 20000005;
  99.     procedure AS_Execute {Flags(2), (4/4) CC:0, INV:1, DBG:4}(const ProviderName: {VT_8:0}WideString; 
  100.                                                               const CommandText: {VT_8:0}WideString; 
  101.                                                               var Params: {VT_12:1}OleVariant; 
  102.                                                               var OwnerData: {VT_12:1}OleVariant); dispid 20000006;
  103.   end;
  104.  
  105. // *********************************************************************//
  106. // The Class CoCustomerData provides a Create and CreateRemote method to          
  107. // create instances of the default interface ICustomerData exposed by              
  108. // the CoClass CustomerData. The functions are intended to be used by             
  109. // clients wishing to automate the CoClass objects exposed by the         
  110. // server of this typelibrary.                                            
  111. // *********************************************************************//
  112.   CoCustomerData = class
  113.     class function Create: ICustomerData;
  114.     class function CreateRemote(const MachineName: string): ICustomerData;
  115.   end;
  116.  
  117.  
  118. // *********************************************************************//
  119. // OLE Server Proxy class declaration
  120. // Server Object    : TCustomerData
  121. // Help String      : CustomerData Object
  122. // Default Interface: ICustomerData
  123. // Def. Intf. DISP? : No
  124. // Event   Interface: 
  125. // TypeFlags        : (2) CanCreate
  126. // *********************************************************************//
  127. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  128.   TCustomerDataProperties= class;
  129. {$ENDIF}
  130.   TCustomerData = class(TOleServer)
  131.   private
  132.     FIntf:        ICustomerData;
  133. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  134.     FProps:       TCustomerDataProperties;
  135.     function      GetServerProperties: TCustomerDataProperties;
  136. {$ENDIF}
  137.     function      GetDefaultInterface: ICustomerData;
  138.   protected
  139.     procedure InitServerData; override;
  140.   {CoClassWriteArrayPropMethods}
  141.   public
  142.     constructor Create(AOwner: TComponent); override;
  143.     destructor  Destroy; override;
  144.     procedure Connect; override;
  145.     procedure ConnectTo(svrIntf: ICustomerData);
  146.     procedure Disconnect; override;
  147.   {CoClassWriteMethods}
  148.     function  AS_ApplyUpdates {Flags(1), (6/5) CC:0, INV:1, DBG:3}(const ProviderName: {VT_8:0}WideString; 
  149.                                                                    Delta: {VT_12:0}OleVariant; 
  150.                                                                    MaxErrors: {VT_3:0}Integer; 
  151.                                                                    out ErrorCount: {VT_3:1}Integer; 
  152.                                                                    var OwnerData: {VT_12:1}OleVariant): OleVariant;
  153.     function  AS_GetRecords {Flags(1), (8/7) CC:0, INV:1, DBG:3}(const ProviderName: {VT_8:0}WideString; 
  154.                                                                  Count: {VT_3:0}Integer; 
  155.                                                                  out RecsOut: {VT_3:1}Integer; 
  156.                                                                  Options: {VT_3:0}Integer; 
  157.                                                                  const CommandText: {VT_8:0}WideString; 
  158.                                                                  var Params: {VT_12:1}OleVariant; 
  159.                                                                  var OwnerData: {VT_12:1}OleVariant): OleVariant;
  160.     function  AS_DataRequest {Flags(1), (3/2) CC:0, INV:1, DBG:3}(const ProviderName: {VT_8:0}WideString; 
  161.                                                                   Data: {VT_12:0}OleVariant): OleVariant;
  162.     function  AS_GetProviderNames {Flags(1), (1/0) CC:0, INV:1, DBG:3}: OleVariant;
  163.     function  AS_GetParams {Flags(1), (3/2) CC:0, INV:1, DBG:3}(const ProviderName: {VT_8:0}WideString; 
  164.                                                                 var OwnerData: {VT_12:1}OleVariant): OleVariant;
  165.     function  AS_RowRequest {Flags(1), (5/4) CC:0, INV:1, DBG:3}(const ProviderName: {VT_8:0}WideString; 
  166.                                                                  Row: {VT_12:0}OleVariant; 
  167.                                                                  RequestType: {VT_3:0}Integer; 
  168.                                                                  var OwnerData: {VT_12:1}OleVariant): OleVariant;
  169.     procedure AS_Execute {Flags(1), (4/4) CC:0, INV:1, DBG:3}(const ProviderName: {VT_8:0}WideString; 
  170.                                                               const CommandText: {VT_8:0}WideString; 
  171.                                                               var Params: {VT_12:1}OleVariant; 
  172.                                                               var OwnerData: {VT_12:1}OleVariant);
  173.     property  DefaultInterface: ICustomerData read GetDefaultInterface;
  174.   {CoClassWriteProperties}
  175.   {CoClassWriteProperties}
  176.   published
  177. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  178.     property Server: TCustomerDataProperties read GetServerProperties;
  179. {$ENDIF}
  180.   end;
  181.  
  182. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  183. // *********************************************************************//
  184. // OLE Server Properties Proxy Class
  185. // Server Object    : TCustomerData
  186. // (This object is used by the IDE's Property Inspector to allow editing
  187. //  of the properties of this server)
  188. // *********************************************************************//
  189.  TCustomerDataProperties = class(TPersistent)
  190.   private
  191.     FServer:    TCustomerData;
  192.     function    GetDefaultInterface: ICustomerData;
  193.     constructor Create(AServer: TCustomerData);
  194.   protected
  195.   public
  196.     property DefaultInterface: ICustomerData read GetDefaultInterface;
  197.   published
  198.   end;
  199. {$ENDIF}
  200.  
  201.  
  202. procedure Register;
  203.  
  204. implementation
  205.  
  206. uses ComObj;
  207.  
  208. class function CoCustomerData.Create: ICustomerData;
  209. begin
  210.   Result := CreateComObject(CLASS_CustomerData) as ICustomerData;
  211. end;
  212.  
  213. class function CoCustomerData.CreateRemote(const MachineName: string): ICustomerData;
  214. begin
  215.   Result := CreateRemoteComObject(MachineName, CLASS_CustomerData) as ICustomerData;
  216. end;
  217.  
  218. procedure TCustomerData.InitServerData;
  219. const
  220.   CServerData: TServerData = (
  221.     ClassID:   '{930FAEE3-0DC1-11D3-AA8A-00A024C11562}';
  222.     IntfIID:   '{930FAEE1-0DC1-11D3-AA8A-00A024C11562}';
  223.     EventIID:  '';
  224.     LicenseKey: nil;
  225.     Version: 500);
  226. begin
  227.   ServerData := @CServerData;
  228. end;
  229.  
  230. procedure TCustomerData.Connect;
  231. var
  232.   punk: IUnknown;
  233. begin
  234.   if FIntf = nil then
  235.   begin
  236.     punk := GetServer;
  237.     Fintf:= punk as ICustomerData;
  238.   end;
  239. end;
  240.  
  241. procedure TCustomerData.ConnectTo(svrIntf: ICustomerData);
  242. begin
  243.   Disconnect;
  244.   FIntf := svrIntf;
  245. end;
  246.  
  247. procedure TCustomerData.DisConnect;
  248. begin
  249.   if Fintf <> nil then
  250.   begin
  251.     FIntf := nil;
  252.   end;
  253. end;
  254.  
  255. function TCustomerData.GetDefaultInterface: ICustomerData;
  256. begin
  257.   if FIntf = nil then
  258.     Connect;
  259.   Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
  260.   Result := FIntf;
  261. end;
  262.  
  263. constructor TCustomerData.Create(AOwner: TComponent);
  264. begin
  265.   inherited Create(AOwner);
  266. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  267.   FProps := TCustomerDataProperties.Create(Self);
  268. {$ENDIF}
  269. end;
  270.  
  271. destructor TCustomerData.Destroy;
  272. begin
  273. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  274.   FProps.Free;
  275. {$ENDIF}
  276.   inherited Destroy;
  277. end;
  278.  
  279. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  280. function TCustomerData.GetServerProperties: TCustomerDataProperties;
  281. begin
  282.   Result := FProps;
  283. end;
  284. {$ENDIF}
  285.  
  286. function  TCustomerData.AS_ApplyUpdates {Flags(1), (6/5) CC:0, INV:1, DBG:3}(const ProviderName: {VT_8:0}WideString; 
  287.                                                                              Delta: {VT_12:0}OleVariant; 
  288.                                                                              MaxErrors: {VT_3:0}Integer; 
  289.                                                                              out ErrorCount: {VT_3:1}Integer; 
  290.                                                                              var OwnerData: {VT_12:1}OleVariant): OleVariant;
  291. begin
  292.   Result := DefaultInterface.AS_ApplyUpdates {Flags(1), (6/5) CC:0, INV:1, DBG:7}(ProviderName{VT_8:0}, 
  293.                                                                                   Delta{VT_12:0}, 
  294.                                                                                   MaxErrors{VT_3:0}, 
  295.                                                                                   ErrorCount{VT_3:1}, 
  296.                                                                                   OwnerData{VT_12:1});
  297. end;
  298.  
  299. function  TCustomerData.AS_GetRecords {Flags(1), (8/7) CC:0, INV:1, DBG:3}(const ProviderName: {VT_8:0}WideString; 
  300.                                                                            Count: {VT_3:0}Integer; 
  301.                                                                            out RecsOut: {VT_3:1}Integer; 
  302.                                                                            Options: {VT_3:0}Integer; 
  303.                                                                            const CommandText: {VT_8:0}WideString; 
  304.                                                                            var Params: {VT_12:1}OleVariant; 
  305.                                                                            var OwnerData: {VT_12:1}OleVariant): OleVariant;
  306. begin
  307.   Result := DefaultInterface.AS_GetRecords {Flags(1), (8/7) CC:0, INV:1, DBG:7}(ProviderName{VT_8:0}, 
  308.                                                                                 Count{VT_3:0}, 
  309.                                                                                 RecsOut{VT_3:1}, 
  310.                                                                                 Options{VT_3:0}, 
  311.                                                                                 CommandText{VT_8:0}, 
  312.                                                                                 Params{VT_12:1}, 
  313.                                                                                 OwnerData{VT_12:1});
  314. end;
  315.  
  316. function  TCustomerData.AS_DataRequest {Flags(1), (3/2) CC:0, INV:1, DBG:3}(const ProviderName: {VT_8:0}WideString; 
  317.                                                                             Data: {VT_12:0}OleVariant): OleVariant;
  318. begin
  319.   Result := DefaultInterface.AS_DataRequest {Flags(1), (3/2) CC:0, INV:1, DBG:7}(ProviderName{VT_8:0}, 
  320.                                                                                  Data{VT_12:0});
  321. end;
  322.  
  323. function  TCustomerData.AS_GetProviderNames {Flags(1), (1/0) CC:0, INV:1, DBG:3}: OleVariant;
  324. begin
  325.   Result := DefaultInterface.AS_GetProviderNames {Flags(1), (1/0) CC:0, INV:1, DBG:7};
  326. end;
  327.  
  328. function  TCustomerData.AS_GetParams {Flags(1), (3/2) CC:0, INV:1, DBG:3}(const ProviderName: {VT_8:0}WideString; 
  329.                                                                           var OwnerData: {VT_12:1}OleVariant): OleVariant;
  330. begin
  331.   Result := DefaultInterface.AS_GetParams {Flags(1), (3/2) CC:0, INV:1, DBG:7}(ProviderName{VT_8:0}, 
  332.                                                                                OwnerData{VT_12:1});
  333. end;
  334.  
  335. function  TCustomerData.AS_RowRequest {Flags(1), (5/4) CC:0, INV:1, DBG:3}(const ProviderName: {VT_8:0}WideString; 
  336.                                                                            Row: {VT_12:0}OleVariant; 
  337.                                                                            RequestType: {VT_3:0}Integer; 
  338.                                                                            var OwnerData: {VT_12:1}OleVariant): OleVariant;
  339. begin
  340.   Result := DefaultInterface.AS_RowRequest {Flags(1), (5/4) CC:0, INV:1, DBG:7}(ProviderName{VT_8:0}, 
  341.                                                                                 Row{VT_12:0}, 
  342.                                                                                 RequestType{VT_3:0}, 
  343.                                                                                 OwnerData{VT_12:1});
  344. end;
  345.  
  346. procedure TCustomerData.AS_Execute {Flags(1), (4/4) CC:0, INV:1, DBG:3}(const ProviderName: {VT_8:0}WideString; 
  347.                                                                         const CommandText: {VT_8:0}WideString; 
  348.                                                                         var Params: {VT_12:1}OleVariant; 
  349.                                                                         var OwnerData: {VT_12:1}OleVariant);
  350. begin
  351.   DefaultInterface.AS_Execute {Flags(1), (4/4) CC:0, INV:1, DBG:7}(ProviderName{VT_8:0}, 
  352.                                                                    CommandText{VT_8:0}, 
  353.                                                                    Params{VT_12:1}, 
  354.                                                                    OwnerData{VT_12:1});
  355. end;
  356.  
  357. {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  358. constructor TCustomerDataProperties.Create(AServer: TCustomerData);
  359. begin
  360.   inherited Create;
  361.   FServer := AServer;
  362. end;
  363.  
  364. function TCustomerDataProperties.GetDefaultInterface: ICustomerData;
  365. begin
  366.   Result := FServer.DefaultInterface;
  367. end;
  368.  
  369. {$ENDIF}
  370.  
  371. procedure Register;
  372. begin
  373.   RegisterComponents('Servers',[TCustomerData]);
  374. end;
  375.  
  376. end.
  377.