DRAWOBJ.H
上传用户:bangxh
上传日期:2007-01-31
资源大小:42235k
文件大小:2k
源码类别:

Windows编程

开发平台:

Visual C++

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