home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / mts4.cab / TServer_Human.h < prev    next >
C/C++ Source or Header  |  1997-11-14  |  2KB  |  72 lines

  1. // Filename: Human.h
  2. //
  3. // Description:  Definition of CHuman
  4. //
  5. // This file is provided as part of the Microsoft Transaction Server Samples
  6. //
  7. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT 
  8. // WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, 
  9. // INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES 
  10. // OF MERCHANTABILITY AND/OR FITNESS FOR A  PARTICULAR 
  11. // PURPOSE.
  12. //
  13. // Copyright (C) 1997 Microsoft Corporation, All rights reserved
  14.  
  15. #if !defined(AFX_HUMAN_H__CAAD7FA2_F22D_11D0_B5CB_00C04FB957D8__INCLUDED_)
  16. #define AFX_HUMAN_H__CAAD7FA2_F22D_11D0_B5CB_00C04FB957D8__INCLUDED_
  17.  
  18. #if _MSC_VER >= 1000
  19. #pragma once
  20. #endif // _MSC_VER >= 1000
  21.  
  22. #include "resource.h"       // main symbols
  23.  
  24. /////////////////////////////////////////////////////////////////////////////
  25. // CHuman
  26.  
  27. class CHuman : 
  28.     public CComDualImpl<IHuman, &IID_IHuman, &LIBID_TSERVERLib>, 
  29.     public ISupportErrorInfo,
  30.     public CComObjectRoot,
  31.     public CComCoClass<CHuman,&CLSID_Human>
  32. {
  33. public:
  34.     CHuman() {}
  35.  
  36. private:
  37.     long plField [3][3];
  38.     
  39.     void inline CHuman::InitArray () {
  40.         for (int i = 0; i < 3; i ++)
  41.             for (int j = 0; j < 3; j ++)
  42.                 plField[i][j] = 0;
  43.     }
  44.  
  45.     HRESULT CHuman::LoadArray (long lGameID);
  46.     HRESULT CHuman::SaveArray (long lGameID);
  47.     long CHuman::HowManyTurns ();
  48.     bool CHuman::IsWin (long lPlayer);
  49.  
  50. BEGIN_COM_MAP(CHuman)
  51.     COM_INTERFACE_ENTRY(IDispatch)
  52.     COM_INTERFACE_ENTRY(IHuman)
  53.     COM_INTERFACE_ENTRY(ISupportErrorInfo)
  54. END_COM_MAP()
  55. //DECLARE_NOT_AGGREGATABLE(CHuman) 
  56. // Remove the comment from the line above if you don't want your object to 
  57. // support aggregation. 
  58.  
  59. DECLARE_REGISTRY_RESOURCEID(IDR_Human)
  60. // ISupportsErrorInfo
  61.     STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  62.  
  63. // IHuman
  64.  
  65. public:
  66.     STDMETHODIMP EnterNewGame (IN BSTR bstrLocalName, OUT VARIANT* pvGameID, OUT VARIANT* pvName, OUT VARIANT* pvOrder);
  67.     STDMETHODIMP NewMove (IN long lGameID, IN long lOrder, IN long lX, IN long lY, OUT VARIANT* pvWin);
  68.     STDMETHODIMP GetNewMove (IN long lGameID, IN long lOrder, OUT VARIANT* pvName, OUT VARIANT* pvFoeX, OUT VARIANT* pvFoeY, OUT VARIANT* pvWin, OUT VARIANT* pvUpdate);
  69. };
  70.  
  71. #endif // !defined(AFX_HUMAN_H__CAAD7FA2_F22D_11D0_B5CB_00C04FB957D8__INCLUDED_)
  72.