Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
2.1 KiB

  1. // RotObj.h : Declaration of the CContentRotator
  2. #include "resource.h" // main symbols
  3. #include <asptlb.h>
  4. #include "context.h"
  5. class CTipList; // forward declaration
  6. /////////////////////////////////////////////////////////////////////////////
  7. // ContRot
  8. class CContentRotator :
  9. public CComDualImpl<IContentRotator, &IID_IContentRotator, &LIBID_ContentRotator>,
  10. public ISupportErrorInfo,
  11. public CComObjectRoot,
  12. public CComCoClass<CContentRotator,&CLSID_ContentRotator>
  13. {
  14. public:
  15. CContentRotator();
  16. ~CContentRotator();
  17. BEGIN_COM_MAP(CContentRotator)
  18. COM_INTERFACE_ENTRY(IDispatch)
  19. COM_INTERFACE_ENTRY(IContentRotator)
  20. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  21. COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pUnkMarshaler.p)
  22. END_COM_MAP()
  23. //DECLARE_NOT_AGGREGATABLE(CContentRotator)
  24. // Remove the comment from the line above if you don't want your object to
  25. // support aggregation. The default is to support it
  26. DECLARE_REGISTRY(CContentRotator,
  27. _T("MSWC.ContentRotator.1"),
  28. _T("MSWC.ContentRotator"),
  29. IDS_CONTENTROTATOR_DESC,
  30. THREADFLAGS_BOTH)
  31. // ISupportsErrorInfo
  32. STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  33. // IContentRotator
  34. public:
  35. // for free-threaded marshalling
  36. DECLARE_GET_CONTROLLING_UNKNOWN()
  37. HRESULT FinalConstruct()
  38. {
  39. return CoCreateFreeThreadedMarshaler(
  40. GetControllingUnknown(), &m_pUnkMarshaler.p );
  41. }
  42. void FinalRelease()
  43. {
  44. m_pUnkMarshaler.Release();
  45. }
  46. STDMETHOD(ChooseContent)(
  47. BSTR bstrDataFile,
  48. BSTR* pbstrRetVal);
  49. STDMETHOD(GetAllContent)(
  50. BSTR bstrDataFile);
  51. private:
  52. CTipList* m_ptl;
  53. CTipList* m_ptlUsed; // List of tips already sent
  54. CRITICAL_SECTION m_CS;
  55. HRESULT
  56. _ChooseContent(
  57. BSTR bstrPhysicalDataFile,
  58. BSTR* pbstrRetVal);
  59. HRESULT
  60. _ReadDataFile(
  61. BSTR bstrPhysicalDataFile,
  62. BOOL fForceReread);
  63. CComPtr<IUnknown> m_pUnkMarshaler;
  64. };