home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / Database / ejemplos / CORBA16 / miserv_TLB.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1999-04-07  |  7.1 KB  |  188 lines

  1. unit miserv_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.11.1.63  $
  15. // File generated on 07/04/99 10:36:41 from Type Library described below.
  16.  
  17. // ************************************************************************ //
  18. // Type Lib: D:\conferen\CORBA16\Miserv1.tlb
  19. // IID\LCID: {C2A54FA6-53B7-11D2-AC35-02608C6CCF39}\0
  20. // Helpfile: 
  21. // HelpString: Project1 Library
  22. // Version:    1.0
  23. // ************************************************************************ //
  24.  
  25. interface
  26.  
  27. uses Windows, ActiveX, Classes, Graphics, OleCtrls, StdVCL, SysUtils, CORBAObj, OrbPas, CorbaStd;
  28.  
  29. // *********************************************************************//
  30. // GUIDS declared in the TypeLibrary. Following prefixes are used:      //
  31. //   Type Libraries     : LIBID_xxxx                                    //
  32. //   CoClasses          : CLASS_xxxx                                    //
  33. //   DISPInterfaces     : DIID_xxxx                                     //
  34. //   Non-DISP interfaces: IID_xxxx                                      //
  35. // *********************************************************************//
  36. const
  37.   LIBID_miserv: TGUID = '{C2A54FA6-53B7-11D2-AC35-02608C6CCF39}';
  38.   IID_ITMIAPLICACION: TGUID = '{C2A54FA7-53B7-11D2-AC35-02608C6CCF39}';
  39.   CLASS_TMIAPLICACION: TGUID = '{C2A54FA9-53B7-11D2-AC35-02608C6CCF39}';
  40. type
  41.  
  42. // *********************************************************************//
  43. // Forward declaration of interfaces defined in Type Library            //
  44. // *********************************************************************//
  45.   ITMIAPLICACION = interface;
  46.   ITMIAPLICACIONDisp = dispinterface;
  47.  
  48. // *********************************************************************//
  49. // Declaration of CoClasses defined in Type Library                     //
  50. // (NOTE: Here we map each CoClass to its Default Interface)            //
  51. // *********************************************************************//
  52.   TMIAPLICACION = ITMIAPLICACION;
  53.  
  54.  
  55. // *********************************************************************//
  56. // Interface: ITMIAPLICACION
  57. // Flags:     (4416) Dual OleAutomation Dispatchable
  58. // GUID:      {C2A54FA7-53B7-11D2-AC35-02608C6CCF39}
  59. // *********************************************************************//
  60.   ITMIAPLICACION = interface(IDataBroker)
  61.     ['{C2A54FA7-53B7-11D2-AC35-02608C6CCF39}']
  62.     function Get_Table1: IProvider; safecall;
  63.     function Get_Query1: IProvider; safecall;
  64.     property Table1: IProvider read Get_Table1;
  65.     property Query1: IProvider read Get_Query1;
  66.   end;
  67.  
  68. // *********************************************************************//
  69. // DispIntf:  ITMIAPLICACIONDisp
  70. // Flags:     (4416) Dual OleAutomation Dispatchable
  71. // GUID:      {C2A54FA7-53B7-11D2-AC35-02608C6CCF39}
  72. // *********************************************************************//
  73.   ITMIAPLICACIONDisp = dispinterface
  74.     ['{C2A54FA7-53B7-11D2-AC35-02608C6CCF39}']
  75.     property Table1: IProvider readonly dispid 1;
  76.     property Query1: IProvider readonly dispid 2;
  77.     function GetProviderNames: OleVariant; dispid 22929905;
  78.   end;
  79.  
  80.   TTMIAPLICACIONStub = class(TDataBrokerStub, ITMIAPLICACION)
  81.   public
  82.     function Get_Table1: IProvider; safecall;
  83.     function Get_Query1: IProvider; safecall;
  84.   end;
  85.  
  86.   TTMIAPLICACIONSkeleton = class(TDataBrokerSkeleton)
  87.   private
  88.     FIntf: ITMIAPLICACION;
  89.   public
  90.     constructor Create(const InstanceName: string; const Impl: IUnknown); override;
  91.     procedure GetImplementation(out Impl: IUnknown); override; stdcall;
  92.   published
  93.     procedure Get_Table1(const InBuf: IMarshalInBuffer; Cookie: Pointer);
  94.     procedure Get_Query1(const InBuf: IMarshalInBuffer; Cookie: Pointer);
  95.   end;
  96.  
  97.   CoTMIAPLICACION = class
  98.     class function Create: ITMIAPLICACION;
  99.     class function CreateRemote(const MachineName: string): ITMIAPLICACION;
  100.   end;
  101.  
  102.   TTMIAPLICACIONCorbaFactory = class
  103.     class function CreateInstance(const InstanceName: string): ITMIAPLICACION;
  104.   end;
  105.  
  106. implementation
  107.  
  108. uses ComObj;
  109.  
  110. { TTMIAPLICACIONStub }
  111.  
  112. function TTMIAPLICACIONStub.Get_Table1: IProvider;
  113. var
  114.   OutBuf: IMarshalOutBuffer;
  115.   InBuf: IMarshalInBuffer;
  116. begin
  117.   FStub.CreateRequest('Get_Table1', True, OutBuf);
  118.   FStub.Invoke(OutBuf, InBuf);
  119.   Result := UnmarshalObject(InBuf, IProvider) as IProvider;
  120. end;
  121.  
  122. function TTMIAPLICACIONStub.Get_Query1: IProvider;
  123. var
  124.   OutBuf: IMarshalOutBuffer;
  125.   InBuf: IMarshalInBuffer;
  126. begin
  127.   FStub.CreateRequest('Get_Query1', True, OutBuf);
  128.   FStub.Invoke(OutBuf, InBuf);
  129.   Result := UnmarshalObject(InBuf, IProvider) as IProvider;
  130. end;
  131.  
  132. { TTMIAPLICACIONSkeleton }
  133.  
  134. constructor TTMIAPLICACIONSkeleton.Create(const InstanceName: string; const Impl: IUnknown);
  135. begin
  136.   inherited;
  137.   inherited InitSkeleton('TMIAPLICACION', InstanceName, 'IDL:miserv/ITMIAPLICACION:1.0', tmMultiThreaded, True);
  138.   FIntf := Impl as ITMIAPLICACION;
  139. end;
  140.  
  141. procedure TTMIAPLICACIONSkeleton.GetImplementation(out Impl: IUnknown);
  142. begin
  143.   Impl := FIntf;
  144. end;
  145.  
  146. procedure TTMIAPLICACIONSkeleton.Get_Table1(const InBuf: IMarshalInBuffer; Cookie: Pointer);
  147. var
  148.   OutBuf: IMarshalOutBuffer;
  149.   Retval: IProvider;
  150. begin
  151.   Retval := FIntf.Get_Table1;
  152.   FSkeleton.GetReplyBuffer(Cookie, OutBuf);
  153.   MarshalObject(OutBuf, IProvider, Retval);
  154. end;
  155.  
  156. procedure TTMIAPLICACIONSkeleton.Get_Query1(const InBuf: IMarshalInBuffer; Cookie: Pointer);
  157. var
  158.   OutBuf: IMarshalOutBuffer;
  159.   Retval: IProvider;
  160. begin
  161.   Retval := FIntf.Get_Query1;
  162.   FSkeleton.GetReplyBuffer(Cookie, OutBuf);
  163.   MarshalObject(OutBuf, IProvider, Retval);
  164. end;
  165.  
  166. class function CoTMIAPLICACION.Create: ITMIAPLICACION;
  167. begin
  168.   Result := CreateComObject(CLASS_TMIAPLICACION) as ITMIAPLICACION;
  169. end;
  170.  
  171. class function CoTMIAPLICACION.CreateRemote(const MachineName: string): ITMIAPLICACION;
  172. begin
  173.   Result := CreateRemoteComObject(MachineName, CLASS_TMIAPLICACION) as ITMIAPLICACION;
  174. end;
  175.  
  176. class function TTMIAPLICACIONCorbaFactory.CreateInstance(const InstanceName: string): ITMIAPLICACION;
  177. begin
  178.   Result := CorbaFactoryCreateStub('IDL:miserv/TMIAPLICACIONFactory:1.0', 'TMIAPLICACION',
  179.     InstanceName, '', ITMIAPLICACION) as ITMIAPLICACION;
  180. end;
  181.  
  182. initialization
  183.   CorbaStubManager.RegisterStub(ITMIAPLICACION, TTMIAPLICACIONStub);
  184.   CorbaInterfaceIDManager.RegisterInterface(ITMIAPLICACION, 'IDL:miserv/ITMIAPLICACION:1.0');
  185.   CorbaSkeletonManager.RegisterSkeleton(ITMIAPLICACION, TTMIAPLICACIONSkeleton);
  186.  
  187. end.
  188.