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

  1. [!outputon] // $Revision:   1.0.1.4  $
  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. // ThreadingModel : [!ThreadingModel]
  13. // Dual Interface : [!Dual]
  14. // Default ProgID : [!ProgID]
  15. // Description    : [!Description]
  16. /////////////////////////////////////////////////////////////////////////////
  17. class ATL_NO_VTABLE [!ClassName] : 
  18.   public CComObjectRootEx<CComSingleThreadModel>,
  19.   public CComCoClass<[!ClassName], &CLSID_[!CoClassName]>,
  20. [!if=(Dual, "TRUE")]
  21.   public IDispatchImpl<[!InterfaceName], &IID_[!InterfaceName], &LIBID_[!LibName]>,
  22. [!else]
  23.   public [!InterfaceName],
  24. [!endif]
  25.   public TASPObject
  26. {
  27. public:
  28.   [!ClassName]()
  29.   {
  30.   }
  31.  
  32.   // Data used when registering Object 
  33.   //
  34. [!if=(ThreadingModel, "Single")]
  35.   DECLARE_THREADING_MODEL(otSingle);
  36. [!endif]
  37. [!if=(ThreadingModel, "Apartment")]
  38.   DECLARE_THREADING_MODEL(otApartment);
  39. [!endif]
  40. [!if=(ThreadingModel, "Free")]
  41.   DECLARE_THREADING_MODEL(otFree);
  42. [!endif]
  43. [!if=(ThreadingModel, "Both")]
  44.   DECLARE_THREADING_MODEL(otBoth);
  45. [!endif]
  46. [!if=(ThreadingModel, "Neutral")]
  47.   DECLARE_THREADING_MODEL(otNeutral);
  48. [!endif]
  49.   DECLARE_PROGID("");
  50.   DECLARE_DESCRIPTION("[!Description]");
  51.  
  52.   // Function invoked to (un)register object
  53.   //
  54.   static HRESULT WINAPI UpdateRegistry(BOOL bRegister)
  55.   {
  56.     TTypedComServerRegistrarT<[!ClassName]> 
  57.     regObj(GetObjectCLSID(), GetProgID(), GetDescription());
  58.     return regObj.UpdateRegistry(bRegister);
  59.   }
  60.  
  61. DECLARE_NOT_AGGREGATABLE([!ClassName])
  62.  
  63. BEGIN_COM_MAP([!ClassName])
  64.   COM_INTERFACE_ENTRY([!InterfaceName])
  65. [!if=(Dual, "TRUE")]
  66.   COM_INTERFACE_ENTRY2(IDispatch, [!InterfaceName])
  67. [!endif]
  68. END_COM_MAP()
  69.  
  70. // [!InterfaceName]
  71. public:
  72.  
  73. };
  74.  
  75. #endif //[IDEHeaderName]
  76.