home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_07.cab / simple.h < prev    next >
C/C++ Source or Header  |  1997-10-25  |  2KB  |  53 lines

  1. // Simple.h : Declaration of the CSimple
  2.  
  3.  
  4. #include "resource.h"       // main symbols
  5.  
  6. /////////////////////////////////////////////////////////////////////////////
  7. // CATLSmpl
  8.  
  9. class CSimple : 
  10.     public CComDualImpl<ISimple, &IID_ISimple, &LIBID_CATLSmpl>, 
  11.     public ISupportErrorInfo,
  12.     public CComObjectRoot,
  13.     public CComCoClass<CSimple,&CLSID_CSimple>
  14. {
  15. public:
  16.     CSimple();
  17. BEGIN_COM_MAP(CSimple)
  18.     COM_INTERFACE_ENTRY(IDispatch)
  19.     COM_INTERFACE_ENTRY(ISimple)
  20.     COM_INTERFACE_ENTRY(ISupportErrorInfo)
  21.     COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pUnkMarshaler.p)
  22. END_COM_MAP()
  23. //DECLARE_NOT_AGGREGATABLE(CSimple) 
  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.  
  27. DECLARE_REGISTRY(CSimple, _T("IISSample.C++ATLSimple.1"), _T("IISSample.C++ATLSimple"), IDS_SIMPLE_DESC, THREADFLAGS_BOTH)
  28. // ISupportsErrorInfo
  29.     STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  30.  
  31. // ISimple
  32. public:
  33.     // for free-threaded marshalling
  34. DECLARE_GET_CONTROLLING_UNKNOWN()
  35.     HRESULT FinalCountruct()
  36.     {
  37.         return CoCreateFreeThreadedMarshaler(
  38.             GetControllingUnknown(), &m_pUnkMarshaler.p );
  39.     }
  40.     void FinalRelease()
  41.     {
  42.         m_pUnkMarshaler.Release();
  43.     }
  44.  
  45.     STDMETHOD(get_myProperty)(BSTR* pbstrOutValue);
  46.     STDMETHOD(put_myProperty)(BSTR bstrInValue);
  47.     STDMETHOD(myMethod) (BSTR bstrIn, BSTR* pbstrOut);
  48.  
  49. private:
  50.     CComBSTR            m_bstrMyProperty;
  51.     CComPtr<IUnknown>    m_pUnkMarshaler;
  52. };
  53.