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

  1. // Driver.h : Declaration of the CDriver
  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 "mdrivres.h"       // main symbols
  15. #include <afxtempl.h>
  16.  
  17. /////////////////////////////////////////////////////////////////////////////
  18. // Drive
  19. struct foo
  20. {
  21.     foo() {nPos = 0;nDir=1;}
  22.     int nPos;
  23.     int nDir;
  24. };
  25.  
  26. class CDriver :
  27.     public IDispatchImpl<IRandomEvent, &IID_IRandomEvent, &LIBID_CONNECTLib>,
  28.     public CComObjectRoot
  29. {
  30. public:
  31.     CDriver() {}
  32. BEGIN_COM_MAP(CDriver)
  33.     COM_INTERFACE_ENTRY(IDispatch)
  34.     COM_INTERFACE_ENTRY(IRandomEvent)
  35. END_COM_MAP()
  36.  
  37. // IRandomEvent
  38.     STDMETHOD(Fire)(long l);
  39.     int m_nID;
  40.     CMap<long, long, foo, foo> m_mapPos;
  41.     _ThreadModel::AutoCriticalSection m_cs;
  42. public:
  43. };
  44.