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 / icars.h < prev    next >
Text File  |  1997-08-05  |  5KB  |  145 lines

  1. /*+==========================================================================
  2.   File:      ICARS.H
  3.  
  4.   Summary:   This is the common include file for the Car-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:   ICar, IUtilityCar, ICruiseCar, ISample.
  14.  
  15.   Functions: none
  16.  
  17.   Origin:    10-7-95: atrent - Factored out of COMOBJ and DLLSERVE.
  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(ICARS_H)
  35. #define ICARS_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: ICar
  42.  
  43.   Summary:   Basic Interface that can add propulsion, steering, etc, for
  44.              Car-like COM Objects.
  45.  
  46.   Methods:   Shift
  47.                Shift the main transmission gears.
  48.              Clutch
  49.                Engage/disengage the clutch.
  50.              Speed
  51.                Accelerate/brake the car to a specified speed.
  52.              Steer
  53.                Steer the car.
  54. I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I-I*/
  55. DECLARE_INTERFACE_(ICar, IUnknown)
  56. {
  57.   // IUnknown methods.
  58.   STDMETHOD(QueryInterface) (THIS_ REFIID, PPVOID) PURE;
  59.   STDMETHOD_(ULONG,AddRef)  (THIS) PURE;
  60.   STDMETHOD_(ULONG,Release) (THIS) PURE;
  61.  
  62.   // ICar methods.
  63.   STDMETHOD(Shift)   (THIS_ short) PURE;
  64.   STDMETHOD(Clutch)  (THIS_ short) PURE;
  65.   STDMETHOD(Speed)   (THIS_ short) PURE;
  66.   STDMETHOD(Steer)   (THIS_ short) PURE;
  67. };
  68.  
  69.  
  70. /*I+I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I
  71.   Interface: IUtility
  72.  
  73.   Summary:   Interface that can add sport-utility offroad systems features
  74.              for Car-like COM Objects.
  75.  
  76.   Methods:   Offroad
  77.                Shift the transfer case for specified 4-wheel drive mode.
  78.              Winch
  79.                Turn front-mounted Winch on/off.
  80. I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I-I*/
  81. DECLARE_INTERFACE_(IUtility, IUnknown)
  82. {
  83.   // IUnknown methods.
  84.   STDMETHOD(QueryInterface) (THIS_ REFIID, PPVOID) PURE;
  85.   STDMETHOD_(ULONG,AddRef)  (THIS) PURE;
  86.   STDMETHOD_(ULONG,Release) (THIS) PURE;
  87.  
  88.   // IUtility methods.
  89.   STDMETHOD(Offroad)   (THIS_ short) PURE;
  90.   STDMETHOD(Winch)     (THIS_ short) PURE;
  91. };
  92.  
  93.  
  94. /*I+I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I
  95.   Interface: ICruise
  96.  
  97.   Summary:   Interface that can add cruise control features for
  98.              Car-like COM Objects.
  99.  
  100.   Methods:   Engage
  101.                Turns the cruise control system on/off.
  102.              Adjust
  103.                Adjusts the cruise speed up or down by 3 Mph increments.
  104. I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I-I*/
  105. DECLARE_INTERFACE_(ICruise, IUnknown)
  106. {
  107.   // IUnknown methods.
  108.   STDMETHOD(QueryInterface) (THIS_ REFIID, PPVOID) PURE;
  109.   STDMETHOD_(ULONG,AddRef)  (THIS) PURE;
  110.   STDMETHOD_(ULONG,Release) (THIS) PURE;
  111.  
  112.   // ICruise methods.
  113.   STDMETHOD(Engage) (THIS_ BOOL) PURE;
  114.   STDMETHOD(Adjust) (THIS_ BOOL) PURE;
  115. };
  116.  
  117.  
  118. /*I+I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I+++I
  119.   Interface: ISample
  120.  
  121.   Summary:   Utility Interface for Code Sample servers.
  122.  
  123.   Methods:   Init
  124.                Initializes the Server as a code sample (eg, to log server
  125.                activity to the Client's trace log facility).
  126.              AboutBox
  127.                Commands Server to show it's about box dialog.
  128. I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I-I*/
  129. DECLARE_INTERFACE_(ISample, IUnknown)
  130. {
  131.   // IUnknown methods.
  132.   STDMETHOD(QueryInterface) (THIS_ REFIID, PPVOID) PURE;
  133.   STDMETHOD_(ULONG,AddRef)  (THIS) PURE;
  134.   STDMETHOD_(ULONG,Release) (THIS) PURE;
  135.  
  136.   // ISample methods.
  137.   STDMETHOD(Init)     (THIS_ HWND, PVOID) PURE;
  138.   STDMETHOD(AboutBox) (THIS_ HWND) PURE;
  139. };
  140.  
  141.  
  142. #endif // RC_INCLUDE
  143.  
  144. #endif // ICARS_H
  145.