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 / locserve / server.h < prev    next >
C/C++ Source or Header  |  1997-08-30  |  3KB  |  94 lines

  1. /*+==========================================================================
  2.   File:      SERVER.H
  3.  
  4.   Summary:   Internal include file for the LOCSERVE.DLL server code
  5.              sample.  Contains class declarations, resource IDs and string
  6.              macros for internal use in constructing this EXE as a local
  7.              COM component server.  Declares the CServer server control
  8.              object class.
  9.  
  10.              For a comprehensive tutorial code tour of this module's
  11.              contents and offerings see the tutorial LOCSERVE.HTM file.
  12.              For more specific technical details on the internal workings
  13.              see the comments dispersed throughout the module's source code.
  14.  
  15.   Classes:   CServer.
  16.  
  17.   Functions: none
  18.  
  19.   Origin:    8-29-97: atrent - Editor-inheritance from SERVER.H in
  20.                the DLLSERVE Tutorial Code Sample. [Revised]
  21.  
  22. ----------------------------------------------------------------------------
  23.   This file is part of the Microsoft COM Tutorial Code Samples.
  24.  
  25.   Copyright (C) Microsoft Corporation, 1997.  All rights reserved.
  26.  
  27.   This source code is intended only as a supplement to Microsoft
  28.   Development Tools and/or on-line documentation.  See these other
  29.   materials for detailed information regarding Microsoft code samples.
  30.  
  31.   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  32.   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  33.   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  34.   PARTICULAR PURPOSE.
  35. ==========================================================================+*/
  36.  
  37.  
  38. #if !defined(SERVER_H)
  39. #define SERVER_H
  40.  
  41. #ifdef __cplusplus
  42.  
  43. /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
  44.   Class:    CServer
  45.  
  46.   Summary:  Class to encapsulate control of this COM server (eg, handle
  47.             Lock and Object counting, encapsulate otherwise global data).
  48.  
  49.   Methods:  none
  50. C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
  51. class CServer
  52. {
  53.   public:
  54.     CServer(void);
  55.     ~CServer(void);
  56.  
  57.     void Lock(void);
  58.     void Unlock(void);
  59.     void ObjectsUp(void);
  60.     void ObjectsDown(void);
  61.     BOOL OpenFactories(void);
  62.     BOOL CloseFactories(void);
  63.  
  64.     // A place to store the server's instance handle.
  65.     HINSTANCE m_hInstServer;
  66.  
  67.     // A place to store the server's main window.
  68.     HWND m_hWndServer;
  69.  
  70.     // Global Server living Object count.
  71.     LONG m_cObjects;
  72.  
  73.     // Global Server Client Lock count.
  74.     LONG m_cLocks;
  75.  
  76.     // Some member variables to store pointers to Class Factories.
  77.     IUnknown* m_pCFCar;
  78.     IUnknown* m_pCFUtilityCar;
  79.     IUnknown* m_pCFCruiseCar;
  80.  
  81.     // Some member variables to store Class Factory registration keys.
  82.     DWORD m_dwCFCar;
  83.     DWORD m_dwCFUtilityCar;
  84.     DWORD m_dwCFCruiseCar;
  85. };
  86.  
  87. #endif // __cplusplus
  88.  
  89. // Allow other internal LOCSERVE modules to get at the globals.
  90. extern CServer*  g_pServer;
  91. extern CSendLog* g_pMsgLog;
  92.  
  93. #endif // SERVER_H
  94.