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 / dllclien / dllclien.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-05  |  6.2 KB  |  182 lines

  1. /*+==========================================================================
  2.   File:      DLLCLIEN.H
  3.  
  4.   Summary:   Include file for the DLLCLIEN code sample application.
  5.              In addition to class definitions, this DLLCLIEN.H file
  6.              contains definitions of the application's menu, string,
  7.              and other resource IDs.
  8.  
  9.              Based largely on the DLLUSER.EXE source code, this include
  10.              file adds resource IDs for a set of new menus for exercising
  11.              the several COM Components manipulated in this code sample
  12.              as a COM Client of those components housed the the DLLSERVE
  13.              server.
  14.  
  15.              For a comprehensive tutorial code tour of DLLCLIEN's
  16.              contents and offerings see the tutorial DLLCLIEN.HTM file.
  17.              For more specific technical details on the internal workings
  18.              see the comments dispersed throughout the DLLCLIEN source code.
  19.  
  20.   Classes:   CMainWindow
  21.  
  22.   Functions: WinMain
  23.  
  24.   Origin:    9-20-95: atrent - Editor-inheritance from the DLLUSER 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(DLLCLIEN_H)
  42. #define DLLCLIEN_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.   TCHAR m_szFileName[MAX_PATH];
  67.   CMsgBox*  m_pMsgBox;
  68.   CMsgLog*  m_pMsgLog;
  69.  
  70.   // A method for getting an interface on a COM object.
  71.   BOOL GetInterface(IUnknown* pObj, REFIID riid, PPVOID ppv);
  72.   // Some member variables to store pointers to Car-like COM Objects.
  73.   // We save pointers to each COM objects controlling IUnknown.
  74.   IUnknown* m_pCar;
  75.   IUnknown* m_pUtilityCar;
  76.   IUnknown* m_pCruiseCar;
  77.   IUnknown* m_pUtilityCruiseCar;
  78.   ISample*  m_pCarSample;
  79.  
  80. protected:
  81.   LRESULT WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
  82.  
  83. private:
  84.   LRESULT DoMenu(WPARAM wParam, LPARAM lParam);
  85.  
  86.   WORD m_wWidth;
  87.   WORD m_wHeight;
  88.   TCHAR m_szHelpFile[MAX_PATH];
  89.   TCHAR m_szFileTitle[MAX_PATH];
  90.   TEXTMETRIC m_tm;
  91.   OPENFILENAME m_ofnFile;
  92. };
  93.  
  94. #endif // __cplusplus
  95.  
  96. // Window Class String Macros.
  97. #define MAIN_WINDOW_TITLE_STR       "DLLCLIEN: Tutorial Code Sample"
  98. #define MAIN_WINDOW_CLASS_NAME_STR  "DLLCLIENWindow"
  99. #define MAIN_WINDOW_CLASS_MENU_STR  "DLLCLIENMenu"
  100.  
  101. // File Name String Macros.
  102. #define SERVER_TUTFILE_STR          "dllserve.htm"
  103. #define REGISTER_TUTFILE_STR        "register.htm"
  104.  
  105. // OpenFile-related String Macros.
  106. #define OFN_DEFAULTFILES_STR "All Files (*.*)\0*.*\0"
  107. #define OFN_DEFAULTTITLE_STR "Open File"
  108.  
  109. // File Menu Command Identifiers.
  110. #define IDM_FILE_EXIT               1000
  111.  
  112. // Car Menu Command Identifiers.
  113. #define IDM_CAR_CREATE              1100
  114. #define IDM_CAR_RELEASE             1101
  115. #define IDM_CAR_SHIFT               1102
  116. #define IDM_CAR_CLUTCH              1103
  117. #define IDM_CAR_SPEED               1104
  118. #define IDM_CAR_STEER               1105
  119.  
  120. // UtilityCar Menu Command Identifiers.
  121. #define IDM_UCAR_CREATE             1200
  122. #define IDM_UCAR_RELEASE            1201
  123. #define IDM_UCAR_SHIFT              1202
  124. #define IDM_UCAR_CLUTCH             1203
  125. #define IDM_UCAR_SPEED              1204
  126. #define IDM_UCAR_STEER              1205
  127. #define IDM_UCAR_OFFROAD            1206
  128. #define IDM_UCAR_WINCH              1207
  129.  
  130. // CruiseCar Menu Command Identifiers.
  131. #define IDM_CCAR_CREATE             1300
  132. #define IDM_CCAR_RELEASE            1301
  133. #define IDM_CCAR_SHIFT              1302
  134. #define IDM_CCAR_CLUTCH             1303
  135. #define IDM_CCAR_SPEED              1304
  136. #define IDM_CCAR_STEER              1305
  137. #define IDM_CCAR_ENGAGE             1306
  138. #define IDM_CCAR_ADJUST             1307
  139.  
  140. // UtilityCruiseCar Menu Command Identifiers.
  141. #define IDM_UCRU_CREATE             1400
  142. #define IDM_UCRU_RELEASE            1401
  143. #define IDM_UCRU_SHIFT              1402
  144. #define IDM_UCRU_CLUTCH             1403
  145. #define IDM_UCRU_SPEED              1404
  146. #define IDM_UCRU_STEER              1405
  147. #define IDM_UCRU_ENGAGE             1406
  148. #define IDM_UCRU_ADJUST             1407
  149. #define IDM_UCRU_OFFROAD            1408
  150. #define IDM_UCRU_WINCH              1409
  151.  
  152. // Log Menu Command Identifiers.
  153. #define IDM_LOG_LOGCLEAR            1890
  154. #define IDM_LOG_LOGGING             1891
  155. #define IDM_LOG_COPYCLIP            1892
  156.  
  157. // Help Menu Command Identifiers.
  158. #define IDM_HELP_CONTENTS           1900
  159. #define IDM_HELP_TUTORIAL           1901
  160. #define IDM_HELP_TUTSERVER          1902
  161. #define IDM_HELP_TUTREGISTER        1903
  162. #define IDM_HELP_READSOURCE         1904
  163. #define IDM_HELP_ABOUT              1905
  164. #define IDM_HELP_ABOUTSERVER        1906
  165.  
  166. // Error-related String Identifiers.
  167. #define IDS_COMINITFAILED           2000
  168. #define IDS_APPINITFAILED           2001
  169. #define IDS_OUTOFMEMORY             2002
  170. #define IDS_NOUNICODE               2003
  171. #define IDS_NOSERVER                2004
  172.  
  173. #define IDS_ASSERT_FAIL             2200
  174.  
  175. // Notice-related String Identifiers.
  176. #define IDS_NOTIMPLEMENTED          2301
  177.  
  178. // Log Message String Identifiers.
  179. #define IDS_START_MESSAGE_LOG       2400
  180.  
  181. #endif
  182.