home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 May / PCP163A.iso / Runimage / Cbuilder4 / Examples / Apps / Autosrv / SRVR_TLB.H < prev    next >
Encoding:
C/C++ Source or Header  |  1999-01-26  |  13.3 KB  |  344 lines

  1. // ************************************************************************ //
  2. // WARNING                                                                  //
  3. // -------                                                                  //
  4. // The types declared in this file were generated from data read from a     //
  5. // Type Library. If this type library is explicitly or indirectly (via      //
  6. // another type library referring to this type library) re-imported, or the //
  7. // 'Refresh' command of the Type Library Editor activated while editing the //
  8. // Type Library, the contents of this file will be regenerated and all      //
  9. // manual modifications will be lost.                                       //
  10. // ************************************************************************ //
  11.  
  12. // C++ TLBWRTR : $Revision:   1.3  $
  13. // File generated on 12/8/98 4:57:32 PM from Type Library described below.
  14.  
  15. // ************************************************************************ //
  16. // Type Lib: D:\bcb4\Examples\Apps\Autosrv\srvr.tlb
  17. // IID\LCID: {921449E3-8905-11D1-B695-0020AF3F4B77}\0
  18. // Helpfile: 
  19. // DepndLst: 
  20. //   (1) v2.0 stdole, (C:\WINDOWS\System32\STDOLE2.TLB)
  21. //   (2) v4.0 StdVCL, (C:\WINDOWS\System32\STDVCL40.DLL)
  22. // ************************************************************************ //
  23. #ifndef   __srvr_TLB_h__
  24. #define   __srvr_TLB_h__
  25.  
  26. #pragma option push -b
  27.  
  28.  
  29. #include <vcl\utilcls.h>
  30. #if !defined(__UTILCLS_H_VERSION) || (__UTILCLS_H_VERSION < 0x0101)
  31. #error "This file requires an newer version of the header file UTILCLS.H"
  32. #endif
  33. #include <ocidl.h>
  34.  
  35. namespace Srvr_tlb
  36. {
  37.  
  38. // *********************************************************************//
  39. // HelpString: srvr Library
  40. // Version:    1.0
  41. // *********************************************************************//
  42.  
  43.  
  44. // *********************************************************************//
  45. // Forward reference of some VCL types (to avoid including STDVCL.HPP)  //
  46. // *********************************************************************//
  47. class IStrings; class IStringsDisp;
  48.  
  49. // *********************************************************************//
  50. // GUIDS declared in the TypeLibrary. Following prefixes are used:      //
  51. //   Type Libraries     : LIBID_xxxx                                    //
  52. //   CoClasses          : CLSID_xxxx                                    //
  53. //   DISPInterfaces     : DIID_xxxx                                     //
  54. //   Non-DISP interfaces: IID_xxxx                                      //
  55. // *********************************************************************//
  56. DEFINE_GUID(LIBID_srvr, 0x921449E3, 0x8905, 0x11D1, 0xB6, 0x95, 0x00, 0x20, 0xAF, 0x3F, 0x4B, 0x77);
  57. DEFINE_GUID(IID_IEditServer, 0x921449E4, 0x8905, 0x11D1, 0xB6, 0x95, 0x00, 0x20, 0xAF, 0x3F, 0x4B, 0x77);
  58. DEFINE_GUID(CLSID_EditServer, 0x921449E5, 0x8905, 0x11D1, 0xB6, 0x95, 0x00, 0x20, 0xAF, 0x3F, 0x4B, 0x77);
  59.  
  60. // *********************************************************************//
  61. // Forward declaration of types defined in TypeLibrary                  //
  62. // *********************************************************************//
  63. interface DECLSPEC_UUID("{921449E4-8905-11D1-B695-0020AF3F4B77}") IEditServer;
  64.  
  65. // *********************************************************************//
  66. // Declaration of CoClasses defined in Type Library                     //
  67. // (NOTE: Here we map each CoClass to its Default Interface)            //
  68. //                                                                      //
  69. // The LIBID_OF_ macro(s) map a LIBID_OF_CoClassName to the GUID of this//
  70. // TypeLibrary. It simplifies the updating of macros when CoClass name  //
  71. // change.                                                              //
  72. // *********************************************************************//
  73. typedef IEditServer EditServer;
  74.  
  75. #define LIBID_OF_EditServer (&LIBID_srvr)
  76. // *********************************************************************//
  77. // Interface: IEditServer
  78. // Flags:     (4416) Dual OleAutomation Dispatchable
  79. // GUID:      {921449E4-8905-11D1-B695-0020AF3F4B77}
  80. // *********************************************************************//
  81. interface IEditServer : public IDispatch
  82. {
  83. public:
  84.   virtual HRESULT STDMETHODCALLTYPE Clear(void) = 0; // [1]
  85.   virtual HRESULT STDMETHODCALLTYPE get_EditNum(int* Value/*[out,retval]*/) = 0; // [2]
  86.   virtual HRESULT STDMETHODCALLTYPE set_EditNum(int Value/*[in]*/) = 0; // [2]
  87.   virtual HRESULT STDMETHODCALLTYPE get_EditStr(BSTR* Value/*[out,retval]*/) = 0; // [3]
  88.   virtual HRESULT STDMETHODCALLTYPE set_EditStr(BSTR Value/*[in]*/) = 0; // [3]
  89.   virtual HRESULT STDMETHODCALLTYPE SetThreeStr(BSTR s1/*[in]*/, BSTR s2/*[in]*/, BSTR s3/*[in]*/, 
  90.                                                 BSTR* result/*[out,retval]*/) = 0; // [4]
  91. };
  92.  
  93. #if !defined(__TLB_NO_INTERFACE_WRAPPERS)
  94. // *********************************************************************//
  95. // SmartIntf: TCOMIEditServer
  96. // Interface: IEditServer
  97. // *********************************************************************//
  98. template <class T /* IEditServer */ >
  99. class TCOMIEditServerT : public TComInterface<IEditServer>, public TComInterfaceBase<IUnknown>
  100. {
  101. public:
  102.   TCOMIEditServerT() {}
  103.   TCOMIEditServerT(IEditServer *intf, bool addRef = false) : TComInterface<IEditServer>(intf, addRef) {}
  104.   TCOMIEditServerT(const TCOMIEditServerT& src) : TComInterface<IEditServer>(src) {}
  105.   TCOMIEditServerT& operator=(const TCOMIEditServerT& src) { Bind(src, true); return *this;}
  106.  
  107.   HRESULT         __fastcall Clear(void);
  108.   HRESULT         __fastcall get_EditNum(int* Value/*[out,retval]*/);
  109.   int             __fastcall get_EditNum(void);
  110.   HRESULT         __fastcall set_EditNum(int Value/*[in]*/);
  111.   HRESULT         __fastcall get_EditStr(BSTR* Value/*[out,retval]*/);
  112.   BSTR            __fastcall get_EditStr(void);
  113.   HRESULT         __fastcall set_EditStr(BSTR Value/*[in]*/);
  114.   HRESULT         __fastcall SetThreeStr(BSTR s1/*[in]*/, BSTR s2/*[in]*/, BSTR s3/*[in]*/, 
  115.                                          BSTR* result/*[out,retval]*/);
  116.   BSTR            __fastcall SetThreeStr(BSTR s1/*[in]*/, BSTR s2/*[in]*/, BSTR s3/*[in]*/);
  117.  
  118.   __property   int             EditNum = {read = get_EditNum, write = set_EditNum};
  119.   __property   BSTR            EditStr = {read = get_EditStr, write = set_EditStr};
  120. };
  121. typedef TCOMIEditServerT<IEditServer> TCOMIEditServer;
  122.  
  123. // *********************************************************************//
  124. // DispIntf:  IEditServer
  125. // Flags:     (4416) Dual OleAutomation Dispatchable
  126. // GUID:      {921449E4-8905-11D1-B695-0020AF3F4B77}
  127. // *********************************************************************//
  128. template<class T>
  129. class IEditServerDispT : public TAutoDriver<IEditServer>
  130. {
  131. public:
  132.   IEditServerDispT(){}
  133.  
  134.   IEditServerDispT(IEditServer *pintf)
  135.   {
  136.     TAutoDriver<IEditServer>::Bind(pintf);
  137.   }
  138.  
  139.   IEditServerDispT& operator=(IEditServer *pintf)
  140.   {
  141.     TAutoDriver<IEditServer>::Bind(pintf);
  142.     return *this;
  143.   }
  144.  
  145.   HRESULT BindDefault(/*Binds to new instance of CoClass EditServer*/)
  146.   {
  147.     return OLECHECK(Bind(CLSID_EditServer));
  148.   }
  149.  
  150.   HRESULT BindRunning(/*Binds to a running instance of CoClass EditServer*/)
  151.   {
  152.     return BindToActive(CLSID_EditServer);
  153.   }
  154.  
  155.   HRESULT         __fastcall Clear();
  156.   HRESULT         __fastcall get_EditNum(int* Value/*[out,retval]*/);
  157.   int             __fastcall get_EditNum(void);
  158.   HRESULT         __fastcall set_EditNum(int Value/*[in]*/);
  159.   HRESULT         __fastcall get_EditStr(BSTR* Value/*[out,retval]*/);
  160.   BSTR            __fastcall get_EditStr(void);
  161.   HRESULT         __fastcall set_EditStr(BSTR Value/*[in]*/);
  162.   HRESULT         __fastcall SetThreeStr(BSTR s1/*[in]*/, BSTR s2/*[in]*/, BSTR s3/*[in]*/, 
  163.                                          BSTR* result/*[out,retval]*/);
  164.   BSTR            __fastcall SetThreeStr(BSTR s1/*[in]*/, BSTR s2/*[in]*/, BSTR s3/*[in]*/);
  165.  
  166.   __property   int             EditNum = {read = get_EditNum, write = set_EditNum};
  167.   __property   BSTR            EditStr = {read = get_EditStr, write = set_EditStr};
  168. };
  169. typedef IEditServerDispT<IEditServer> IEditServerDisp;
  170.  
  171. // *********************************************************************//
  172. // SmartIntf: TCOMIEditServer
  173. // Interface: IEditServer
  174. // *********************************************************************//
  175. template <class T> HRESULT __fastcall
  176. TCOMIEditServerT<T>::Clear(void)
  177. {
  178.   return (*this)->Clear();
  179. }
  180.  
  181. template <class T> HRESULT __fastcall
  182. TCOMIEditServerT<T>::get_EditNum(int* Value/*[out,retval]*/)
  183. {
  184.   return (*this)->get_EditNum(Value);
  185. }
  186.  
  187. template <class T> int __fastcall
  188. TCOMIEditServerT<T>::get_EditNum(void)
  189. {
  190.   int Value;
  191.   OLECHECK(get_EditNum(&Value));
  192.   return Value;
  193. }
  194.  
  195. template <class T> HRESULT __fastcall
  196. TCOMIEditServerT<T>::set_EditNum(int Value/*[in]*/)
  197. {
  198.   return (*this)->set_EditNum(Value);
  199. }
  200.  
  201. template <class T> HRESULT __fastcall
  202. TCOMIEditServerT<T>::get_EditStr(BSTR* Value/*[out,retval]*/)
  203. {
  204.   return (*this)->get_EditStr(Value);
  205. }
  206.  
  207. template <class T> BSTR __fastcall
  208. TCOMIEditServerT<T>::get_EditStr(void)
  209. {
  210.   BSTR Value;
  211.   OLECHECK(get_EditStr(&Value));
  212.   return Value;
  213. }
  214.  
  215. template <class T> HRESULT __fastcall
  216. TCOMIEditServerT<T>::set_EditStr(BSTR Value/*[in]*/)
  217. {
  218.   return (*this)->set_EditStr(Value);
  219. }
  220.  
  221. template <class T> HRESULT __fastcall
  222. TCOMIEditServerT<T>::SetThreeStr(BSTR s1/*[in]*/, BSTR s2/*[in]*/, BSTR s3/*[in]*/, 
  223.                                  BSTR* result/*[out,retval]*/)
  224. {
  225.   return (*this)->SetThreeStr(s1, s2, s3, result);
  226. }
  227.  
  228. template <class T> BSTR __fastcall
  229. TCOMIEditServerT<T>::SetThreeStr(BSTR s1/*[in]*/, BSTR s2/*[in]*/, BSTR s3/*[in]*/)
  230. {
  231.   BSTR result;
  232.   OLECHECK(SetThreeStr(s1, s2, s3, &result));
  233.   return result;
  234. }
  235.  
  236. // *********************************************************************//
  237. // DispIntf:  IEditServer
  238. // Flags:     (4416) Dual OleAutomation Dispatchable
  239. // GUID:      {921449E4-8905-11D1-B695-0020AF3F4B77}
  240. // *********************************************************************//
  241. template <class T> HRESULT __fastcall
  242. IEditServerDispT<T>::Clear()
  243. {
  244.   static _TDispID _dispid(*this, OLETEXT("Clear"), DISPID(1));
  245.   return OleFunction(_dispid);
  246. }
  247.  
  248. template <class T> HRESULT __fastcall
  249. IEditServerDispT<T>::get_EditNum(int* Value/*[out,retval]*/)
  250. {
  251.   static _TDispID _dispid(*this, OLETEXT("EditNum"), DISPID(2));
  252.   TAutoArgs<0> _args;
  253.   return OutRetValSetterPtr(Value /*[VT_INT:1]*/, _args, OlePropertyGet(_dispid, _args));
  254. }
  255.  
  256. template <class T> int __fastcall
  257. IEditServerDispT<T>::get_EditNum(void)
  258. {
  259.   int Value;
  260.   this->get_EditNum(&Value);
  261.   return Value;
  262. }
  263.  
  264. template <class T> HRESULT __fastcall
  265. IEditServerDispT<T>::set_EditNum(int Value/*[in]*/)
  266. {
  267.   static _TDispID _dispid(*this, OLETEXT("EditNum"), DISPID(2));
  268.   TAutoArgs<1> _args;
  269.   _args[1] = Value /*[VT_INT:0]*/;
  270.   return OlePropertyPut(_dispid, _args);
  271. }
  272.  
  273. template <class T> HRESULT __fastcall
  274. IEditServerDispT<T>::get_EditStr(BSTR* Value/*[out,retval]*/)
  275. {
  276.   static _TDispID _dispid(*this, OLETEXT("EditStr"), DISPID(3));
  277.   TAutoArgs<0> _args;
  278.   return OutRetValSetterPtr(Value /*[VT_BSTR:1]*/, _args, OlePropertyGet(_dispid, _args));
  279. }
  280.  
  281. template <class T> BSTR __fastcall
  282. IEditServerDispT<T>::get_EditStr(void)
  283. {
  284.   BSTR Value;
  285.   this->get_EditStr(&Value);
  286.   return Value;
  287. }
  288.  
  289. template <class T> HRESULT __fastcall
  290. IEditServerDispT<T>::set_EditStr(BSTR Value/*[in]*/)
  291. {
  292.   static _TDispID _dispid(*this, OLETEXT("EditStr"), DISPID(3));
  293.   TAutoArgs<1> _args;
  294.   _args[1] = Value /*[VT_BSTR:0]*/;
  295.   return OlePropertyPut(_dispid, _args);
  296. }
  297.  
  298. template <class T> HRESULT __fastcall
  299. IEditServerDispT<T>::SetThreeStr(BSTR s1/*[in]*/, BSTR s2/*[in]*/, BSTR s3/*[in]*/, 
  300.                                  BSTR* result/*[out,retval]*/)
  301. {
  302.   static _TDispID _dispid(*this, OLETEXT("SetThreeStr"), DISPID(4));
  303.   TAutoArgs<3> _args;
  304.   _args[1] = s1 /*[VT_BSTR:0]*/;
  305.   _args[2] = s2 /*[VT_BSTR:0]*/;
  306.   _args[3] = s3 /*[VT_BSTR:0]*/;
  307.   return OutRetValSetterPtr(result /*[VT_BSTR:1]*/, _args, OleFunction(_dispid, _args));
  308. }
  309.  
  310. template <class T> BSTR __fastcall
  311. IEditServerDispT<T>::SetThreeStr(BSTR s1/*[in]*/, BSTR s2/*[in]*/, BSTR s3/*[in]*/)
  312. {
  313.   BSTR result;
  314.   this->SetThreeStr(s1, s2, s3, &result);
  315.   return result;
  316. }
  317.  
  318. // *********************************************************************//
  319. // The following typedefs expose classes (named CoCoClassName) that     //
  320. // provide static Create() and CreateRemote(LPWSTR machineName) methods //
  321. // for creating an instance of an exposed object. These functions can   //
  322. // be used by client wishing to automate CoClasses exposed by this      //
  323. // typelibrary.                                                         //
  324. // *********************************************************************//
  325.  
  326. // *********************************************************************//
  327. // COCLASS DEFAULT INTERFACE CREATOR
  328. // CoClass  : EditServer
  329. // Interface: TCOMIEditServer
  330. // *********************************************************************//
  331. typedef TCoClassCreatorT<TCOMIEditServer, IEditServer, &CLSID_EditServer, &IID_IEditServer> CoEditServer;
  332. #endif  //   __TLB_NO_INTERFACE_WRAPPERS
  333.  
  334.  
  335. };     // namespace Srvr_tlb
  336.  
  337. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  338. using  namespace Srvr_tlb;
  339. #endif
  340.  
  341. #pragma option pop
  342.  
  343. #endif // __srvr_TLB_h__
  344.