home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Internet 2000 May / MICD_2000_05.iso / CBuilder5 / INSTALL / DATA1.CAB / Program_Built_Files / ObjRepos / aspmts.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-02-01  |  2.2 KB  |  80 lines

  1. [!outputon] // $Revision:   1.0.1.6  $
  2. // [!HeaderName] : Declaration of the [!ClassName]
  3.  
  4. #ifndef [!IDEHeaderName]
  5. #define [!IDEHEaderName]
  6.  
  7. #include "[!TypeLibModuleName].H"
  8. #include <asphlpr.h>
  9.  
  10. /////////////////////////////////////////////////////////////////////////////
  11. // [!ClassName]     Implements [!InterfaceName], default interface of [!CoClassName]
  12. [!if=(ConnectionPointsEnabled, "TRUE")]
  13. //                  and [!InterfaceName]Events, the default source interface
  14. [!endif]
  15. // ThreadingModel : [!ThreadingModel]
  16. // Dual Interface : [!Dual]
  17. // Event Support  : [!ConnectionPointsEnabled]
  18. // Default ProgID : [!ProgID]
  19. // Description    : [!Description]
  20. /////////////////////////////////////////////////////////////////////////////
  21. class ATL_NO_VTABLE [!ClassName] : 
  22.   public CComObjectRootEx<CComSingleThreadModel>,
  23.   public CComCoClass<[!ClassName], &CLSID_[!CoClassName]>,
  24. [!if=(Dual, "TRUE")]
  25.   public IDispatchImpl<[!InterfaceName], &IID_[!InterfaceName], &LIBID_[!LibName]>,
  26. [!else]
  27.   public [!InterfaceName],
  28. [!endif]
  29.   public TMTSASPObject
  30. {
  31. public:
  32.   [!ClassName]()
  33.   {
  34.   }
  35.  
  36.   // Data used when registering Object 
  37.   //
  38. [!if=(ThreadingModel, "Single")]
  39.   DECLARE_THREADING_MODEL(otSingle);
  40. [!endif]
  41. [!if=(ThreadingModel, "Apartment")]
  42.   DECLARE_THREADING_MODEL(otApartment);
  43. [!endif]
  44. [!if=(ThreadingModel, "Free")]    // MTS does not support Free Threading Model (Default to Both)
  45.   DECLARE_THREADING_MODEL(otBoth);
  46. [!endif]
  47. [!if=(ThreadingModel, "Both")]
  48.   DECLARE_THREADING_MODEL(otBoth);
  49. [!endif]
  50. [!if=(ThreadingModel, "Neutral")]
  51.   DECLARE_THREADING_MODEL(otNeutral);
  52. [!endif]
  53.   DECLARE_PROGID("");
  54.   DECLARE_DESCRIPTION("[!Description]");
  55.  
  56.   // Function invoked to (un)register object
  57.   //
  58.   static HRESULT WINAPI UpdateRegistry(BOOL bRegister)
  59.   {
  60.     TTypedComServerRegistrarT<[!ClassName]> 
  61.     regObj(GetObjectCLSID(), GetProgID(), GetDescription());
  62.     return regObj.UpdateRegistry(bRegister);
  63.   }
  64.  
  65. DECLARE_NOT_AGGREGATABLE([!ClassName])
  66.  
  67. BEGIN_COM_MAP([!ClassName])
  68.   COM_INTERFACE_ENTRY([!InterfaceName])
  69. [!if=(Dual, "TRUE")]
  70.   COM_INTERFACE_ENTRY2(IDispatch, [!InterfaceName])
  71. [!endif]
  72. END_COM_MAP()
  73.  
  74. // [!InterfaceName]
  75. public:
  76.  
  77. };
  78.  
  79. #endif //[!IDEHeaderName]
  80.