home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / atl / dcom / drawserv / drawobj.h < prev    next >
C/C++ Source or Header  |  1998-03-26  |  2KB  |  59 lines

  1. // DrawObj.h : Declaration of the CDrawObj
  2. //
  3. // This is a part of the Active Template Library.
  4. // Copyright (C) 1996-1998 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Active Template Library Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Active Template Library product.
  12.  
  13.  
  14. #include "drawres.h"       // main symbols
  15. #include "CPIDServ.h"
  16.  
  17. /////////////////////////////////////////////////////////////////////////////
  18. // DrawServ
  19.  
  20. class CDrawObj :
  21.     public IDispatchImpl<IDrawServ, &IID_IDrawServ, &LIBID_DRAWSERVLib>,
  22.     public IConnectionPointContainerImpl<CDrawObj>,
  23.     public CProxyIDrawServ<CDrawObj>,
  24.     public ISupportErrorInfo,
  25.     public CComObjectRoot,
  26.     public CComCoClass<CDrawObj,&CLSID_CDrawServ>
  27. {
  28. public:
  29.     DECLARE_CLASSFACTORY_SINGLETON(CDrawObj);
  30.  
  31. BEGIN_COM_MAP(CDrawObj)
  32.     COM_INTERFACE_ENTRY2(IDispatch,IDrawServ)
  33.     COM_INTERFACE_ENTRY(IDrawServ)
  34.     COM_INTERFACE_ENTRY(ISupportErrorInfo)
  35.     COM_INTERFACE_ENTRY_IMPL(IConnectionPointContainer)
  36. END_COM_MAP()
  37. //DECLARE_NOT_AGGREGATABLE(CDrawObj)
  38. // Remove the comment from the line above if you don't want your object to
  39. // support aggregation.  The default is to support it
  40.  
  41. BEGIN_CONNECTION_POINT_MAP(CDrawObj)
  42.     CONNECTION_POINT_ENTRY(IID_IDrawServ)
  43. END_CONNECTION_POINT_MAP()
  44.  
  45. DECLARE_REGISTRY_RESOURCEID(IDR_DrawServ1)
  46. // ISupportsErrorInfo
  47.     STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  48.  
  49. // IDrawServ
  50. public:
  51.     STDMETHOD(Draw)(
  52.         long x1, long y1,
  53.         long x2, long y2,
  54.         unsigned long col)
  55.     {
  56.         return CProxyIDrawServ<CDrawObj>::Draw(x1, y1, x2, y2, col);
  57.     }
  58. };
  59.