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 / dcomdraw / dcomdraw.h < prev    next >
C/C++ Source or Header  |  1997-08-30  |  6KB  |  182 lines

  1. /*+==========================================================================
  2.   File:      DCOMDRAW.H
  3.  
  4.   Summary:   Include file for the DCOMDRAW code sample application. In
  5.              addition to class definitions, this DCOMDRAW.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 DCOMDRAW's contents
  10.              and offerings see the tutorial DCOMDRAW.HTM file. For
  11.              more specific technical details on the internal workings see
  12.              the comments dispersed throughout the DCOMDRAW source code.
  13.  
  14.   Classes:   CMainWindow.
  15.  
  16.   Functions: WinMain.
  17.  
  18.   Origin:    8-23-97: 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(DCOMDRAW_H)
  36. #define DCOMDRAW_H
  37.  
  38. #ifdef __cplusplus
  39.  
  40. extern COSERVERINFO g_ServerInfo;
  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.     LONG m_lWidth;
  71.     LONG m_lHeight;
  72.     TCHAR m_szFileTitle[MAX_PATH];
  73.     TCHAR m_szHelpFile[MAX_PATH];
  74.     TEXTMETRIC m_tm;
  75.     OPENFILENAME m_ofnFile;
  76. };
  77.  
  78.  
  79. /*C+C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C+++C
  80.   Class:    CDlgLoadRemote
  81.  
  82.   Summary:  Class to encapsulate the Load Remote Dialog.
  83.  
  84.   Methods:  DialogProc
  85.               Dialog procedure
  86. C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C---C-C*/
  87. class CDlgLoadRemote: public CVirDialog
  88. {
  89. public:
  90.   BOOL DialogProc(
  91.          HWND hWndDlg,
  92.          UINT uMsg,
  93.          WPARAM wParam,
  94.          LPARAM lParam);
  95. };
  96.  
  97. #endif // __cplusplus
  98.  
  99. // Window Class String Macros.
  100. #define MAIN_APP_NAME_STR           "DCOMDRAW: "
  101. #define MAIN_WINDOW_TITLE_STR       "DCOMDRAW: Shared Drawing"
  102. #define MAIN_WINDOW_MASTER_STR      "DCOMDRAW: Shared Drawing [***TALK***]"
  103. #define MAIN_WINDOW_SLAVE_STR       "DCOMDRAW: Shared Drawing [LISTEN]"
  104. #define MAIN_WINDOW_CLASS_NAME_STR  "DCOMDRAWWindow"
  105. #define MAIN_WINDOW_CLASS_MENU_STR  "DCOMDRAWMenu"
  106.  
  107. // File Name String Macros.
  108. #define SERVER_TUTFILE_STR          "dcdserve.htm"
  109. #define MARSHAL_TUTFILE_STR         "dcdmarsh.htm"
  110.  
  111. // OpenFile-related String Macros.
  112. #define OFN_DEFAULTFILES_STR "All Files (*.*)\0*.*\0"
  113. #define OFN_DEFAULTTITLE_STR "Open File"
  114.  
  115. // Error strings.
  116. #define REMOTE_CREATE_ERR_STR       "Remote Object Creation"
  117. #define LOCAL_CREATE_ERR_STR        "Local Object Creation"
  118.  
  119. // Some compile-time constants for ink thickness in pixels.
  120. enum
  121. {
  122.   INK_THIN = 2,
  123.   INK_MEDIUM = 10,
  124.   INK_THICK = 20
  125. };
  126.  
  127. // Bit constants for the pen cursor.
  128. #define PENCUR_OFF    0
  129. #define PENCUR_ON     1
  130. #define PENCUR_THIN   2
  131. #define PENCUR_MEDIUM 4
  132. #define PENCUR_THICK  8
  133.  
  134.  
  135. // File Menu Command Identifiers.
  136. #define IDM_FILE_LOADREMOTE         1000
  137. #define IDM_FILE_LOADLOCAL          1001
  138. #define IDM_FILE_SAVE               1002
  139. #define IDM_FILE_EXIT               1019
  140.  
  141. // Draw Menu Command Identifiers.
  142. #define IDM_DRAW_MASTER             1100
  143. #define IDM_DRAW_SLAVE              1101
  144. #define IDM_DRAW_REDRAW             1102
  145. #define IDM_DRAW_ERASE              1103
  146.  
  147. // PEN Menu Command Identifiers.
  148. #define IDM_PEN_COLOR               1200
  149. #define IDM_PEN_THIN                1201
  150. #define IDM_PEN_MEDIUM              1202
  151. #define IDM_PEN_THICK               1203
  152.  
  153. // Help Menu Command Identifiers.
  154. #define IDM_HELP_CONTENTS           1900
  155. #define IDM_HELP_TUTORIAL           1901
  156. #define IDM_HELP_TUTSERVER          1902
  157. #define IDM_HELP_TUTMARSH           1903
  158. #define IDM_HELP_READSOURCE         1904
  159. #define IDM_HELP_ABOUT              1905
  160.  
  161. // Error-related String Identifiers.
  162. #define IDS_COMINITFAILED           2000
  163. #define IDS_APPINITFAILED           2001
  164. #define IDS_OUTOFMEMORY             2002
  165. #define IDS_NOUNICODE               2003
  166. #define IDS_NODCOM                  2004
  167. #define IDS_NOSERVER                2005
  168. #define IDS_NOTIMPLEMENTED          2006
  169.  
  170. #define IDS_ASSERT_FAIL             2200
  171.  
  172. // Notice-related String Identifiers.
  173. #define IDS_DRAWING_CHANGED         2300
  174. #define IDS_ASK_SAVE                2301
  175.  
  176. // Dialog IDs.
  177. #define IDD_LOAD_REMOTE             2500
  178. #define IDC_STATIC_MACHINE          2501
  179. #define IDC_EDIT_MACHINE            2502
  180.  
  181. #endif
  182.