home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / winui / resource / msgtable / messages.h < prev    next >
Encoding:
Text File  |  1998-03-30  |  6.9 KB  |  213 lines

  1.  /*
  2.  Microsoft Developer Support
  3.  Copyright (c) 1992-1997 Microsoft Corporation
  4.  
  5.  This file contains the message definitions for the Win32
  6.  messages.exe sample program.
  7. -------------------------------------------------------------------------
  8.  HEADER SECTION
  9.  
  10.  The header section defines names and language identifiers for use
  11.  by the message definitions later in this file. The MessageIdTypedef,
  12.  SeverityNames, FacilityNames, and LanguageNames keywords are
  13.  optional and not required.
  14.  
  15.  
  16.  
  17.  The MessageIdTypedef keyword gives a typedef name that is used in a
  18.  type cast for each message code in the generated include file. Each
  19.  message code appears in the include file with the format: #define
  20.  name ((type) 0xnnnnnnnn) The default value for type is empty, and no
  21.  type cast is generated. It is the programmer's responsibility to
  22.  specify a typedef statement in the application source code to define
  23.  the type. The type used in the typedef must be large enough to
  24.  accomodate the entire 32-bit message code.
  25.  
  26.  
  27.  
  28.  The SeverityNames keyword defines the set of names that are allowed
  29.  as the value of the Severity keyword in the message definition. The
  30.  set is delimited by left and right parentheses. Associated with each
  31.  severity name is a number that, when shifted left by 30, gives the
  32.  bit pattern to logical-OR with the Facility value and MessageId
  33.  value to form the full 32-bit message code. The default value of
  34.  this keyword is:
  35.  
  36.  SeverityNames=(
  37.    Success=0x0
  38.    Informational=0x1
  39.    Warning=0x2
  40.    Error=0x3
  41.    )
  42.  
  43.  Severity values occupy the high two bits of a 32-bit message code.
  44.  Any severity value that does not fit in two bits is an error. The
  45.  severity codes can be given symbolic names by following each value
  46.  with :name
  47.  
  48.  
  49.  
  50.  The FacilityNames keyword defines the set of names that are allowed
  51.  as the value of the Facility keyword in the message definition. The
  52.  set is delimited by left and right parentheses. Associated with each
  53.  facility name is a number that, when shift it left by 16 bits, gives
  54.  the bit pattern to logical-OR with the Severity value and MessageId
  55.  value to form the full 32-bit message code. The default value of
  56.  this keyword is:
  57.  
  58.  FacilityNames=(
  59.    System=0x0FF
  60.    Application=0xFFF
  61.    )
  62.  
  63.  Facility codes occupy the low order 12 bits of the high order
  64.  16-bits of a 32-bit message code. Any facility code that does not
  65.  fit in 12 bits is an error. This allows for 4,096 facility codes.
  66.  The first 256 codes are reserved for use by the system software. The
  67.  facility codes can be given symbolic names by following each value
  68.  with :name
  69.  
  70.  
  71.  The LanguageNames keyword defines the set of names that are allowed
  72.  as the value of the Language keyword in the message definition. The
  73.  set is delimited by left and right parentheses. Associated with each
  74.  language name is a number and a file name that are used to name the
  75.  generated resource file that contains the messages for that
  76.  language. The number corresponds to the language identifier to use
  77.  in the resource table. The number is separated from the file name
  78.  with a colon.
  79.  
  80.  
  81.  Any new names in the source file which don't override the built-in
  82.  names are added to the list of valid languages. This allows an
  83.  application to support private languages with descriptive names.
  84.  
  85.  
  86. -------------------------------------------------------------------------
  87.  MESSAGE DEFINITION SECTION
  88.  
  89.  Following the header section is the body of the Message Compiler
  90.  source file. The body consists of zero or more message definitions.
  91.  Each message definition begins with one or more of the following
  92.  statements:
  93.  
  94.  MessageId = [number|+number]
  95.  Severity = severity_name
  96.  Facility = facility_name
  97.  SymbolicName = name
  98.  
  99.  The MessageId statement marks the beginning of the message
  100.  definition. A MessageID statement is required for each message,
  101.  although the value is optional. If no value is specified, the value
  102.  used is the previous value for the facility plus one. If the value
  103.  is specified as +number then the value used is the previous value
  104.  for the facility, plus the number after the plus sign. Otherwise, if
  105.  a numeric value is given, that value is used. Any MessageId value
  106.  that does not fit in 16 bits is an error.
  107.  
  108.  The Severity and Facility statements are optional. These statements
  109.  specify additional bits to OR into the final 32-bit message code. If
  110.  not specified they default to the value last specified for a message
  111.  definition. The initial values prior to processing the first message
  112.  definition are:
  113.  
  114.  Severity=Success
  115.  Facility=Application
  116.  
  117.  The value associated with Severity and Facility must match one of
  118.  the names given in the FacilityNames and SeverityNames statements in
  119.  the header section. The SymbolicName statement allows you to
  120.  associate a C/C++ symbolic constant with the final 32-bit message
  121.  code.
  122.  */
  123. //
  124. //  Values are 32 bit values layed out as follows:
  125. //
  126. //   3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
  127. //   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
  128. //  +---+-+-+-----------------------+-------------------------------+
  129. //  |Sev|C|R|     Facility          |               Code            |
  130. //  +---+-+-+-----------------------+-------------------------------+
  131. //
  132. //  where
  133. //
  134. //      Sev - is the severity code
  135. //
  136. //          00 - Success
  137. //          01 - Informational
  138. //          10 - Warning
  139. //          11 - Error
  140. //
  141. //      C - is the Customer code flag
  142. //
  143. //      R - is a reserved bit
  144. //
  145. //      Facility - is the facility code
  146. //
  147. //      Code - is the facility's status code
  148. //
  149. //
  150. // Define the facility codes
  151. //
  152. #define FACILITY_SYSTEM                  0x0
  153. #define FACILITY_STUBS                   0x3
  154. #define FACILITY_RUNTIME                 0x2
  155. #define FACILITY_IO_ERROR_CODE           0x4
  156.  
  157.  
  158. //
  159. // Define the severity codes
  160. //
  161. #define STATUS_SEVERITY_WARNING          0x2
  162. #define STATUS_SEVERITY_SUCCESS          0x0
  163. #define STATUS_SEVERITY_INFORMATIONAL    0x1
  164. #define STATUS_SEVERITY_ERROR            0x3
  165.  
  166.  
  167. //
  168. // MessageId: MSG_BAD_COMMAND
  169. //
  170. // MessageText:
  171. //
  172. //  You have chosen an incorrect command.
  173. //
  174. #define MSG_BAD_COMMAND                  ((DWORD)0xC0020001L)
  175.  
  176. //
  177. // MessageId: MSG_BAD_PARM1
  178. //
  179. // MessageText:
  180. //
  181. //  Cannot reconnect to the server.
  182. //
  183. #define MSG_BAD_PARM1                    ((DWORD)0x80040002L)
  184.  
  185. //
  186. // MessageId: MSG_STRIKE_ANY_KEY
  187. //
  188. // MessageText:
  189. //
  190. //  Press any key to continue . . . %0
  191. //
  192. #define MSG_STRIKE_ANY_KEY               ((DWORD)0x00000003L)
  193.  
  194. //
  195. // MessageId: MSG_CMD_DELETE
  196. //
  197. // MessageText:
  198. //
  199. //  File %1 contains %2 which is in error
  200. //
  201. #define MSG_CMD_DELETE                   ((DWORD)0xC0000004L)
  202.  
  203. //
  204. // MessageId: MSG_RETRYS
  205. //
  206. // MessageText:
  207. //
  208. //  There have been %1!d! retrys with %2!d!%% success%! Disconnect from% 
  209. //  the server and retry later.
  210. //
  211. #define MSG_RETRYS                       ((DWORD)0x00000005L)
  212.  
  213.