home *** CD-ROM | disk | FTP | other *** search
/ PC Press 1997 July / Sezamfile97_2.iso / windows / program / activex / axtsamp.exe / TSBRANCH.EXE / STOCLIEN / STOCLIEN.H < prev    next >
C/C++ Source or Header  |  1996-12-29  |  5KB  |  158 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 ActiveX 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. extern CMsgLog* g_pMsgLog;
  41.  
  42. /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
  43.   Class:    CMainWindow
  44.  
  45.   Summary:  Class to encapsulate the application's main window, menu, and
  46.             message dispatching behavior.
  47.  
  48.   Methods:  CMainWindow
  49.               Constructor.
  50.             InitInstance
  51.               Creates a new instance of the main window.
  52. C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
  53. class CMainWindow: public CVirWindow
  54. {
  55.   public:
  56.     CMainWindow();
  57.     ~CMainWindow();
  58.     BOOL InitInstance(HINSTANCE hInst, LPSTR pszCmdLine, int nCmdShow);
  59.  
  60.     TCHAR m_szFileName[MAX_PATH];
  61.     CMsgBox*   m_pMsgBox;
  62.     CGuiPaper* m_pGuiPaper;
  63.  
  64.   protected:
  65.     LRESULT WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
  66.  
  67.   private:
  68.     LRESULT DoMenu(WPARAM wParam, LPARAM lParam);
  69.  
  70.     WORD m_wWidth;
  71.     WORD m_wHeight;
  72.     TCHAR m_szFileTitle[MAX_PATH];
  73.     TCHAR m_szHelpFile[MAX_PATH];
  74.     TEXTMETRIC m_tm;
  75.     OPENFILENAME m_ofnFile;
  76. };
  77.  
  78.  
  79. #endif // __cplusplus
  80.  
  81. // Window Class String Macros.
  82. #define MAIN_APP_NAME_STR           "STOCLIEN: "
  83. #define MAIN_WINDOW_TITLE_STR       "STOCLIEN: stoclien.pap"
  84. #define MAIN_WINDOW_CLASS_NAME_STR  "STOCLIENWindow"
  85. #define MAIN_WINDOW_CLASS_MENU_STR  "STOCLIENMenu"
  86.  
  87. // File Name String Macros.
  88. #define SERVER_TUTFILE_STR          "stoserve.htm"
  89.  
  90. // OpenFile-related String Macros.
  91. #define OFN_DEFAULTFILES_STR "All Files (*.*)\0*.*\0"
  92. #define OFN_DEFAULTTITLE_STR "Open File"
  93.  
  94. // Some compile-time constants for ink thickness in pixels.
  95. enum
  96. {
  97.   INK_THIN = 2,
  98.   INK_MEDIUM = 10,
  99.   INK_THICK = 20
  100. };
  101.  
  102.  
  103. // File Menu Command Identifiers.
  104. #define IDM_FILE_OPEN               1000
  105. #define IDM_FILE_SAVE               1001
  106. #define IDM_FILE_SAVEAS             1002
  107. #define IDM_FILE_EXIT               1020
  108.  
  109. // Draw Menu Command Identifiers.
  110. #define IDM_DRAW_ON                 1100
  111. #define IDM_DRAW_OFF                1101
  112. #define IDM_DRAW_REDRAW             1102
  113. #define IDM_DRAW_ERASE              1103
  114.  
  115. // PEN Menu Command Identifiers.
  116. #define IDM_PEN_COLOR               1200
  117. #define IDM_PEN_THIN                1201
  118. #define IDM_PEN_MEDIUM              1202
  119. #define IDM_PEN_THICK               1203
  120.  
  121. // Sink Menu Command Identifiers.
  122. #define IDM_SINK_ON                 1300
  123. #define IDM_SINK_OFF                1301
  124.  
  125. // Help Menu Command Identifiers.
  126. #define IDM_HELP_CONTENTS           1900
  127. #define IDM_HELP_TUTORIAL           1901
  128. #define IDM_HELP_TUTSERVER          1902
  129. #define IDM_HELP_READSOURCE         1904
  130. #define IDM_HELP_ABOUT              1905
  131. #define IDM_HELP_ABOUTSERVER        1906
  132.  
  133. // Error-related String Identifiers.
  134. #define IDS_COMINITFAILED           2000
  135. #define IDS_APPINITFAILED           2001
  136. #define IDS_OUTOFMEMORY             2002
  137. #define IDS_NOHELPFILE              2003
  138. #define IDS_NOUNICODE               2004
  139. #define IDS_NOSERVER                2005
  140. #define IDS_NOTIMPLEMENTED          2006
  141.  
  142. #define IDS_ASSERT_FAIL             2200
  143.  
  144. // Notice-related String Identifiers.
  145. #define IDS_DRAWING_CHANGED         2300
  146. #define IDS_ASK_SAVE                2301
  147. #define IDS_OFN_PAPFILES            2302
  148. #define IDS_OFN_PAPOPEN             2303
  149. #define IDS_OFN_PAPSAVE             2304
  150.  
  151. // Log Message String Identifiers.
  152. #define IDS_START_MESSAGE_LOG       2400
  153.  
  154. // Help Context IDs.
  155. #define IDH_CONTENTS                0xE142
  156.  
  157. #endif
  158.