home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / com / tutsamp / inc / iball.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-05  |  3.5 KB  |  103 lines

  1. /*+==========================================================================
  2.   File:      IBALL.H
  3.  
  4.   Summary:   This is the common include file for the Ball-related COM
  5.              Interfaces.  The Interface abstract base classes are
  6.              declared.
  7.  
  8.              This file is global to all the Tutorial Code Samples (kept in
  9.              the ..\INC directory).  It is a good practice to factor out
  10.              Interface and GUID specifications to reduce the possibility
  11.              of GUID or interface conflicts.
  12.  
  13.   Classes:   IBall, IBallSink.
  14.  
  15.   Functions: none
  16.  
  17.   Origin:    5-30-96: atrent - Revised for the COM Tutorial Samples.
  18.  
  19. ----------------------------------------------------------------------------
  20.   This file is part of the Microsoft COM Tutorial Code Samples.
  21.  
  22.   Copyright (C) Microsoft Corporation, 1997.  All rights reserved.
  23.  
  24.   This source code is intended only as a supplement to Microsoft
  25.   Development Tools and/or on-line documentation.  See these other
  26.   materials for detailed information regarding Microsoft code samples.
  27.  
  28.   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  29.   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  30.   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  31.   PARTICULAR PURPOSE.
  32. ==========================================================================+*/
  33.  
  34. #if !defined(IBALL_H)
  35. #define IBALL_H
  36.  
  37. #if !defined(RC_INCLUDE)
  38.  
  39.  
  40. /*I+I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I
  41.   Interface: IBall
  42.  
  43.   Summary:   Interface for moving Ball-like COM Objects.
  44.  
  45.   Methods:   Reset
  46.                Init and reset the ball.
  47.              Move
  48.                Move the ball.
  49.              GetBall
  50.                Obtain the ball's current position, extent, and color.
  51. I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I-I*/
  52. DECLARE_INTERFACE_(IBall, IUnknown)
  53. {
  54.   // IUnknown methods.
  55.   STDMETHOD(QueryInterface) (THIS_ REFIID, PPVOID) PURE;
  56.   STDMETHOD_(ULONG,AddRef)  (THIS) PURE;
  57.   STDMETHOD_(ULONG,Release) (THIS) PURE;
  58.  
  59.   // IBall methods.
  60.   STDMETHOD(Reset)      (THIS_ RECT*, SHORT) PURE;
  61.   STDMETHOD(Move)       (THIS_ BOOL) PURE;
  62.   STDMETHOD(GetBall)    (THIS_ POINT*, POINT*, COLORREF*) PURE;
  63. };
  64.  
  65.  
  66. /*I+I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I
  67.   Interface: IBallSink
  68.  
  69.   Summary:   Sink Connection Interface for Ball-like COM Objects that
  70.              communicate events back to the client.
  71.  
  72.   Methods:   BounceBottom
  73.                The virtual ball hit the bottom edge of its bounding
  74.                rectangle and bounced.
  75.              BounceLeft
  76.                The virtual ball hit the left edge of its bounding
  77.                rectangle and bounced.
  78.              BounceRight
  79.                The virtual ball hit the right edge of its bounding
  80.                rectangle and bounced.
  81.              BounceTop
  82.                The virtual ball hit the top edge of its bounding
  83.                rectangle and bounced.
  84. I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I-I*/
  85. DECLARE_INTERFACE_(IBallSink, IUnknown)
  86. {
  87.   // IUnknown methods.
  88.   STDMETHOD(QueryInterface) (THIS_ REFIID, PPVOID) PURE;
  89.   STDMETHOD_(ULONG,AddRef)  (THIS) PURE;
  90.   STDMETHOD_(ULONG,Release) (THIS) PURE;
  91.  
  92.   // IBallSink methods.
  93.   STDMETHOD(BounceBottom)   (THIS) PURE;
  94.   STDMETHOD(BounceLeft)     (THIS) PURE;
  95.   STDMETHOD(BounceRight)    (THIS) PURE;
  96.   STDMETHOD(BounceTop)      (THIS) PURE;
  97. };
  98.  
  99.  
  100. #endif // RC_INCLUDE
  101.  
  102. #endif // IBALL_H
  103.