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

  1. /*+==========================================================================
  2.   File:      STOCLIEN.H
  3.  
  4.   Summary:   Include file for the STOCLIEN code sample application. In
  5.              addition to class definitions, this STOCLIEN.H file contains
  6.              definitions of the application's menu, string, and other
  7.              resource IDs.
  8.  
  9.              For a comprehensive tutorial code tour of STOCLIEN's contents
  10.              and offerings see the tutorial STOCLIEN.HTM file. For
  11.              more specific technical details on the internal workings see
  12.              the comments dispersed throughout the STOCLIEN source code.
  13.  
  14.   Classes:   CMainWindow.
  15.  
  16.   Functions: WinMain.
  17.  
  18.   Origin:    6-10-96: atrent - Editor-inheritance from CONCLIEN source.
  19.  
  20. ----------------------------------------------------------------------------
  21.   This file is part of the Microsoft COM Tutorial Code Samples.
  22.  
  23.   Copyright (C) Microsoft Corporation, 1997.  All rights reserved.
  24.  
  25.   This source code is intended only as a supplement to Microsoft
  26.   Development Tools and/or on-line documentation.  See these other
  27.   materials for detailed information regarding Microsoft code samples.
  28.  
  29.   THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  30.   KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  31.   IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  32.   PARTICULAR PURPOSE.
  33. ==========================================================================+*/
  34.  
  35. #if !defined(STOCLIEN_H)
  36. #define STOCLIEN_H
  37.  
  38. #ifdef __cplusplus
  39.  
  40.  
  41. /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
  42.   Class:    CMainWindow
  43.  
  44.   Summary:  Class to encapsulate the application's main window, menu, and
  45.             message dispatching behavior.
  46.  
  47.   Methods:  CMainWindow
  48.               Constructor.
  49.             InitInstance
  50.               Creates a new instance of the main window.
  51. C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
  52. class CMainWindow: public CVirWindow
  53. {
  54.   public:
  55.     CMainWindow();
  56.     ~CMainWindow();
  57.     BOOL InitInstance(HINSTANCE hInst, LPSTR pszCmdLine, int nCmdShow);
  58.  
  59.     TCHAR m_szFileName[MAX_PATH];
  60.     CMsgBox*   m_pMsgBox;
  61.     CGuiPaper* m_pGuiPaper;
  62.  
  63.   protected:
  64.     LRESULT WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
  65.  
  66.   private:
  67.     LRESULT DoMenu(WPARAM wParam, LPARAM lParam);
  68.  
  69.     WORD m_wWidth;
  70.     WORD m_wHeight;
  71.     TCHAR m_szFileTitle[MAX_PATH];
  72.     TCHAR m_szHelpFile[MAX_PATH];
  73.     TEXTMETRIC m_tm;
  74.     OPENFILENAME m_ofnFile;
  75. };
  76.  
  77.  
  78. #endif // __cplusplus
  79.  
  80. // Window Class String Macros.
  81. #define MAIN_APP_NAME_STR           "STOCLIEN: "
  82. #define MAIN_WINDOW_TITLE_STR       "STOCLIEN: stoclien.pap"
  83. #define MAIN_WINDOW_CLASS_NAME_STR  "STOCLIENWindow"
  84. #define MAIN_WINDOW_CLASS_MENU_STR  "STOCLIENMenu"
  85.  
  86. // File Name String Macros.
  87. #define SERVER_TUTFILE_STR          "stoserve.htm"
  88.  
  89. // OpenFile-related String Macros.
  90. #define OFN_DEFAULTFILES_STR "All Files (*.*)\0*.*\0"
  91. #define OFN_DEFAULTTITLE_STR "Open File"
  92.  
  93. // Some compile-time constants for ink thickness in pixels.
  94. enum
  95. {
  96.   INK_THIN = 2,
  97.   INK_MEDIUM = 10,
  98.   INK_THICK = 20
  99. };
  100.  
  101.  
  102. // File Menu Command Identifiers.
  103. #define IDM_FILE_OPEN               1000
  104. #define IDM_FILE_SAVE               1001
  105. #define IDM_FILE_SAVEAS             1002
  106. #define IDM_FILE_EXIT               1020
  107.  
  108. // Draw Menu Command Identifiers.
  109. #define IDM_DRAW_ON                 1100
  110. #define IDM_DRAW_OFF                1101
  111. #define IDM_DRAW_REDRAW             1102
  112. #define IDM_DRAW_ERASE              1103
  113.  
  114. // PEN Menu Command Identifiers.
  115. #define IDM_PEN_COLOR               1200
  116. #define IDM_PEN_THIN                1201
  117. #define IDM_PEN_MEDIUM              1202
  118. #define IDM_PEN_THICK               1203
  119.  
  120. // Sink Menu Command Identifiers.
  121. #define IDM_SINK_ON                 1300
  122. #define IDM_SINK_OFF                1301
  123.  
  124. // Help Menu Command Identifiers.
  125. #define IDM_HELP_CONTENTS           1900
  126. #define IDM_HELP_TUTORIAL           1901
  127. #define IDM_HELP_TUTSERVER          1902
  128. #define IDM_HELP_READSOURCE         1904
  129. #define IDM_HELP_ABOUT              1905
  130. #define IDM_HELP_ABOUTSERVER        1906
  131.  
  132. // Error-related String Identifiers.
  133. #define IDS_COMINITFAILED           2000
  134. #define IDS_APPINITFAILED           2001
  135. #define IDS_OUTOFMEMORY             2002
  136. #define IDS_NOUNICODE               2003
  137. #define IDS_NOSERVER                2004
  138. #define IDS_NOTIMPLEMENTED          2005
  139.  
  140. #define IDS_ASSERT_FAIL             2200
  141.  
  142. // Notice-related String Identifiers.
  143. #define IDS_DRAWING_CHANGED         2300
  144. #define IDS_ASK_SAVE                2301
  145. #define IDS_OFN_PAPFILES            2302
  146. #define IDS_OFN_PAPOPEN             2303
  147. #define IDS_OFN_PAPSAVE             2304
  148.  
  149. #endif
  150.