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 / licclien / licclien.h < prev    next >
C/C++ Source or Header  |  1997-08-05  |  7KB  |  195 lines

  1. /*+==========================================================================
  2.   File:      LICCLIEN.H
  3.  
  4.   Summary:   Include file for the LICCLIEN code sample application.
  5.              In addition to class definitions, this LICCLIEN.H file
  6.              contains definitions of the application's menu, string,
  7.              and other resource IDs.
  8.  
  9.              Based largely on the DLLCLIEN.EXE source code, this include
  10.              file has resource IDs for the set of new menus for exercising
  11.              the several COM components manipulated in this COM Client.
  12.              Of special interest are the new menus for exercising the
  13.              licensed COM components housed in the partner LICSERVE server.
  14.  
  15.              For a comprehensive tutorial code tour of LICCLIEN's
  16.              contents and offerings see the tutorial LICCLIEN.HTM file.
  17.              For more specific technical details on the internal workings
  18.              see the comments dispersed throughout the LICCLIEN source code.
  19.  
  20.   Classes:   CMainWindow
  21.  
  22.   Functions: WinMain
  23.  
  24.   Origin:    10-5-95: atrent - Editor-inheritance from the DLLCLIEN source.
  25.  
  26. ----------------------------------------------------------------------------
  27.   This file is part of the Microsoft COM Tutorial Code Samples.
  28.  
  29.   Copyright (C) Microsoft Corporation, 1997.  All rights reserved.
  30.  
  31.   This source code is intended only as a supplement to Microsoft
  32.   Development Tools and/or on-line documentation.  See these other
  33.   materials for detailed information regarding Microsoft code samples.
  34.  
  35.   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  36.   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  37.   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  38.   PARTICULAR PURPOSE.
  39. ==========================================================================+*/
  40.  
  41. #if !defined(LICCLIEN_H)
  42. #define LICCLIEN_H
  43.  
  44. #ifdef __cplusplus
  45.  
  46. extern CMsgLog* g_pMsgLog;
  47.  
  48. /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
  49.   Class:    CMainWindow
  50.  
  51.   Summary:  Class to encapsulate the application's main window, menu, and
  52.             message dispatching behavior.
  53.  
  54.   Methods:  CMainWindow
  55.               Constructor.
  56.             InitInstance
  57.               Creates a new instance of the main window.
  58. C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
  59. class CMainWindow: public CVirWindow
  60. {
  61. public:
  62.   CMainWindow();
  63.   ~CMainWindow();
  64.   BOOL InitInstance(HINSTANCE, int);
  65.  
  66.   // A method for getting an interface on a COM object.
  67.   BOOL GetInterface(IUnknown* pObj, REFIID riid, PPVOID ppv);
  68.  
  69.   TCHAR m_szFileName[MAX_PATH];
  70.   CMsgBox*  m_pMsgBox;
  71.   CMsgLog*  m_pMsgLog;
  72.   BSTR      m_bstrLicKey;
  73.  
  74.   // Some member variables to store pointers to Car-like COM Objects.
  75.   // We save pointers to each COM objects controlling IUnknown.
  76.   IUnknown* m_pCar;
  77.   IUnknown* m_pUtilityCar;
  78.   IUnknown* m_pLicCruiseCar;
  79.   IUnknown* m_pUtilityCruiseCar;
  80.  
  81.   // Some cached pointers to the the Car Sample utility objects.
  82.   ISample*  m_pLicCarSample;
  83.   ISample*  m_pDllCarSample;
  84.  
  85. protected:
  86.   LRESULT WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
  87.  
  88. private:
  89.   LRESULT DoMenu(WPARAM wParam, LPARAM lParam);
  90.  
  91.   WORD m_wWidth;
  92.   WORD m_wHeight;
  93.   TCHAR m_szHelpFile[MAX_PATH];
  94.   TCHAR m_szFileTitle[MAX_PATH];
  95.   TEXTMETRIC m_tm;
  96.   OPENFILENAME m_ofnFile;
  97. };
  98.  
  99. #endif // __cplusplus
  100.  
  101. // Window Class String Macros.
  102. #define MAIN_WINDOW_TITLE_STR       "LICCLIEN: Tutorial Code Sample"
  103. #define MAIN_WINDOW_CLASS_NAME_STR  "LICCLIENWindow"
  104. #define MAIN_WINDOW_CLASS_MENU_STR  "LICCLIENMenu"
  105.  
  106. // File Name String Macros.
  107. #define LICSERVE_TUTFILE_STR        "licserve.htm"
  108. #define DLLSERVE_TUTFILE_STR        "dllserve.htm"
  109.  
  110. // OpenFile-related String Macros.
  111. #define OFN_DEFAULTFILES_STR "All Files (*.*)\0*.*\0"
  112. #define OFN_DEFAULTTITLE_STR "Open File"
  113.  
  114. // File Menu Command Identifiers.
  115. #define IDM_FILE_EXIT               1000
  116.  
  117. // Car Menu Command Identifiers.
  118. #define IDM_CAR_CREATE              1100
  119. #define IDM_CAR_RELEASE             1101
  120. #define IDM_CAR_SHIFT               1102
  121. #define IDM_CAR_CLUTCH              1103
  122. #define IDM_CAR_SPEED               1104
  123. #define IDM_CAR_STEER               1105
  124.  
  125. // UtilityCar Menu Command Identifiers.
  126. #define IDM_UCAR_CREATE             1200
  127. #define IDM_UCAR_RELEASE            1201
  128. #define IDM_UCAR_SHIFT              1202
  129. #define IDM_UCAR_CLUTCH             1203
  130. #define IDM_UCAR_SPEED              1204
  131. #define IDM_UCAR_STEER              1205
  132. #define IDM_UCAR_OFFROAD            1206
  133. #define IDM_UCAR_WINCH              1207
  134.  
  135. // LicCruiseCar Menu Command Identifiers.
  136. #define IDM_CCAR_CREATE             1300
  137. #define IDM_CCAR_RELEASE            1301
  138. #define IDM_CCAR_SHIFT              1302
  139. #define IDM_CCAR_CLUTCH             1303
  140. #define IDM_CCAR_SPEED              1304
  141. #define IDM_CCAR_STEER              1305
  142. #define IDM_CCAR_ENGAGE             1306
  143. #define IDM_CCAR_ADJUST             1307
  144.  
  145. // UtilityCruiseCar Menu Command Identifiers.
  146. #define IDM_UCRU_GETLICKEY          1400
  147. #define IDM_UCRU_CLEARLICKEY        1401
  148. #define IDM_UCRU_CREATE             1402
  149. #define IDM_UCRU_RELEASE            1403
  150. #define IDM_UCRU_SHIFT              1404
  151. #define IDM_UCRU_CLUTCH             1405
  152. #define IDM_UCRU_SPEED              1406
  153. #define IDM_UCRU_STEER              1407
  154. #define IDM_UCRU_ENGAGE             1408
  155. #define IDM_UCRU_ADJUST             1409
  156. #define IDM_UCRU_OFFROAD            1410
  157. #define IDM_UCRU_WINCH              1411
  158.  
  159. // Log Menu Command Identifiers.
  160. #define IDM_LOG_LOGCLEAR            1890
  161. #define IDM_LOG_LICSERVER           1891
  162. #define IDM_LOG_DLLSERVER           1892
  163. #define IDM_LOG_LOGGING             1893
  164. #define IDM_LOG_COPYCLIP            1894
  165.  
  166. // Help Menu Command Identifiers.
  167. #define IDM_HELP_CONTENTS           1900
  168. #define IDM_HELP_TUTORIAL           1901
  169. #define IDM_HELP_TUTLICSERVER       1902
  170. #define IDM_HELP_TUTDLLSERVER       1903
  171. #define IDM_HELP_READSOURCE         1904
  172. #define IDM_HELP_ABOUT              1905
  173. #define IDM_HELP_ABOUTLICSERVER     1906
  174. #define IDM_HELP_ABOUTDLLSERVER     1907
  175.  
  176. // Error-related String Identifiers.
  177. #define IDS_COMINITFAILED           2000
  178. #define IDS_APPINITFAILED           2001
  179. #define IDS_OUTOFMEMORY             2002
  180. #define IDS_NOUNICODE               2003
  181. #define IDS_NODLLSERVER             2004
  182. #define IDS_NOLICSERVER             2005
  183. #define IDS_NOLICENSE               2006
  184. #define IDS_NORUNLICENSE            2007
  185.  
  186. #define IDS_ASSERT_FAIL             2200
  187.  
  188. // Notice-related String Identifiers.
  189. #define IDS_NOTIMPLEMENTED          2301
  190.  
  191. // Log Message String Identifiers.
  192. #define IDS_START_MESSAGE_LOG       2400
  193.  
  194. #endif
  195.