home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / vp21beta.zip / OAPIINF.RAR / VPGPI1.INF (.txt) < prev    next >
OS/2 Help File  |  2000-09-07  |  21KB  |  606 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. Virtual Pascal for OS/2 notes ΓòÉΓòÉΓòÉ
  3.  
  4. Virtual Pascal for OS/2 v1.0
  5.  
  6. This help file originally was written for the C language, and has been adapted 
  7. to Pascal for inclusion with Virtual Pascal for OS/2 from fPrint UK Ltd. 
  8.  
  9. The conversion extends to syntax definitions and source code examples, and the 
  10. descriptions are still C specific and can thus be either irrelevant or wrong 
  11. when writing programs for Virtual Pascal.  Since the descriptions in many 
  12. instances will be valid for Pascal, we have included them unaltered. 
  13.  
  14. The example code in this reference are NOT working Pascal code.  Rather, the 
  15. examples should be considered as C programs modified to somewhat resemble 
  16. Pascal syntax, and be used as guidelines only. 
  17.  
  18. For more information about some of the issues discussed here, please refer to 
  19. the printed documentation of Virtual Pascal for OS/2 as well as the large 
  20. number of example programs coming with VP/2. 
  21.  
  22. These help files are licenced from IBM and are the property of IBM.  The 
  23. changes from C to Pascal are (C) 1996 fPrint UK Ltd.  All rights reserved. 
  24.  
  25.  
  26. ΓòÉΓòÉΓòÉ 2. How to Use the GPI Guide and Reference ΓòÉΓòÉΓòÉ
  27.  
  28. This reference is a detailed technical guide and reference for application 
  29. programmers. It gives reference information and code examples to enable you to 
  30. write source code using Graphical Programming Interface functions. 
  31.  
  32. Before you begin to use this information, it would be helpful to understand how 
  33. you can: 
  34.  
  35.      Expand the Contents to see all available topics 
  36.      Obtain additional information for a highlighted word or phrase 
  37.      Use action bar choices 
  38.      Use the programming information. 
  39.  
  40.  How to Use the Contents 
  41.  
  42.  When the Contents window first appears, some topics have a plus (+) sign 
  43.  beside them. The plus sign indicates that additional topics are available. 
  44.  
  45.  To expand the Contents if you are using a mouse, click on the plus sign. If 
  46.  you are using the keyboard, use the Up or Down Arrow key to highlight the 
  47.  topic, and press the plus (+) key. For example, Code Pages has a plus sign 
  48.  beside it. To see additional topics for that heading, click on the plus sign 
  49.  or highlight that topic and press the plus (+) key. 
  50.  
  51.  To view a topic, double-click on the topic (or press the Up or Down Arrow key 
  52.  to highlight the topic, and then press the Enter key). 
  53.  
  54.  How to Obtain Additional Information 
  55.  
  56.  After you select a topic, the information for that topic appears in a window. 
  57.  Highlighted words or phrases indicate that additional information is 
  58.  available. You will notice that certain words and phrases are highlighted in 
  59.  green letters, or in white letters on a black background. These are called 
  60.  hypertext terms. If you are using a mouse, double-click on the highlighted 
  61.  word. If you are using a keyboard, press the Tab key to move to the 
  62.  highlighted word, and then press the Enter key. Additional information then 
  63.  appears in a window. 
  64.  
  65.  How to Use Action Bar Choices 
  66.  
  67.  Several choices are available for managing information presented in the 
  68.  Graphics Programming Interface Programming Reference. There are three 
  69.  pull-down menus on the action bar:  the Services menu, the Options menu, and 
  70.  the Help menu. 
  71.  
  72.  The actions that are selectable from the Services menu operate on the active 
  73.  window currently displayed on the screen. These actions include the following: 
  74.  
  75.  Bookmark 
  76.     Allows you to set a placeholder so you can retrieve information of interest 
  77.     to you. 
  78.  
  79.     When you place a bookmark on a topic, it is added to a list of bookmarks 
  80.     you have previously set. You can view the list, and you can remove one or 
  81.     all bookmarks from the list. If you have not set any bookmarks, the list is 
  82.     empty. 
  83.  
  84.     To set a bookmark, do the following: 
  85.  
  86.       1. Select a topic from the Contents. 
  87.  
  88.       2. When that topic appears, choose the Bookmark option from the Services 
  89.          pull-down. 
  90.  
  91.       3. If you want to change the name used for the bookmark, type the new 
  92.          name in the field. 
  93.  
  94.       4. Click on the Place radio button (or press the Up or Down Arrow key to 
  95.          select it). 
  96.  
  97.       5. Click on OK (or select it and press Enter). The bookmark is then added 
  98.          to the bookmark list. 
  99.  
  100.  Search 
  101.     Allows you to find occurrences of a word or phrase in the current topic, 
  102.     selected topics, or all topics. 
  103.  
  104.     You can specify a word or phrase to be searched. You can also limit the 
  105.     search to a set of topics by first marking the topics in the Contents list. 
  106.  
  107.     To search for a word or phrase in all topics, do the following: 
  108.  
  109.       1. Choose the Search option from the Services pull-down. 
  110.  
  111.       2. Type the word or words to be searched for. 
  112.  
  113.       3. Click on All sections (or press the Up or Down Arrow keys to select 
  114.          it). 
  115.  
  116.       4. Click on Search (or select it and press Enter) to begin the search. 
  117.  
  118.       5. The list of topics where the word or phrase appears is displayed. 
  119.  
  120.  Print 
  121.     Allows you to print one or more topics. You can also print a set of topics 
  122.     by first marking the topics in the Contents list. 
  123.  
  124.     To print the document Contents list, do the following: 
  125.  
  126.       1. Choose Print from the Services pull-down. 
  127.  
  128.       2. Click on Contents (or press the Up or Down Arrow key to select it). 
  129.  
  130.       3. Click on Print (or select it and press Enter). 
  131.  
  132.       4. The Contents list is printed on your printer. 
  133.  
  134.  Copy 
  135.     Allows you to copy a topic that you are viewing to the System Clipboard or 
  136.     to a file that you can edit. You will find this particularly useful for 
  137.     copying syntax definitions and program samples into the application that 
  138.     you are developing. 
  139.  
  140.     You can copy a topic that you are viewing in two ways: 
  141.  
  142.         Copy copies the topic that you are viewing into the System Clipboard. 
  143.          If you are using a Presentation Manager editor (for example, the 
  144.          System Editor) that copies or cuts (or both) to the System Clipboard, 
  145.          and pastes to the System Clipboard, you can easily add the copied 
  146.          information to your program source module. 
  147.  
  148.         Copy to file copies the topic that you are viewing into a temporary 
  149.          file named TEXT.TMP. You can later edit that file by using any editor. 
  150.          You will find TEXT.TMP in the directory where your viewable document 
  151.          resides. 
  152.  
  153.          To copy a topic, do the following: 
  154.  
  155.            1. Expand the Contents list and select a topic. 
  156.  
  157.            2. When the topic appears, choose Copy to file from the Services 
  158.               pull-down. 
  159.  
  160.            3. The system puts the text pertaining to that topic into the 
  161.               temporary file named TEXT.TMP. 
  162.  
  163.     For information on one of the other choices in the Services pull-down, 
  164.     highlight the choice and press the F1 key. 
  165.  
  166.  The actions that are selectable from the Options menu allow you to change the 
  167.  way your Contents list is displayed. To expand the Contents and show all 
  168.  levels for all topics, choose Expand all from the Options pull-down. You can 
  169.  also press the Ctrl and * keys together. For information on one of the other 
  170.  choices in the Options pull-down, highlight the choice and press the F1 key. 
  171.  
  172.  The actions that are selectable from the Help menu allow you to select 
  173.  different types of help information. You can also press the F1 key for help 
  174.  information about the Information Presentation Facility (IPF). 
  175.  
  176.  How to Use the Programming Information 
  177.  
  178.  This document consists of guide and reference information that provides a 
  179.  detailed description of each function, message, constant, and data type. It 
  180.  provides language-dependent information about the functions which enable the 
  181.  user to generate call statements in the C Language. 
  182.  
  183.  Graphical Programming Interface programming information is presented by 
  184.  component, such as Graphics Functions, Graphics Orders, and Data Types, for 
  185.  example: 
  186.  
  187.        ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  188.        Γöé            Contents                     Γöé
  189.        Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  190.        Γöé                                         Γöé
  191.        Γöé  + Graphics Functions                   Γöé
  192.        Γöé  + Graphics Orders                      Γöé
  193.        Γöé  + Data Types                           Γöé
  194.        Γöé                                         Γöé
  195.        ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  196.  
  197.  By clicking on the plus sign beside "Graphics Functions", you see an 
  198.  alphabetic list of the Graphical Programming Interface functions. Selecting a 
  199.  function takes you directly into the reference information for that function. 
  200.  
  201.  Units of reference information are presented in selectable multiple windows or 
  202.  viewports. A viewport is a Presentation Manager window that can be sized, 
  203.  moved, minimized, maximized, or closed. By selecting a unit (in this case, an 
  204.  entry on the Contents list), you will see two windows displayed: 
  205.  
  206.      ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  207.      Γöé Unit Title         Γöé      Selection Title     Γöé
  208.      Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  209.      Γöé Select an item     Γöé                          Γöé
  210.      Γöé                    Γöé                          Γöé
  211.      Γöé Syntax             Γöé                          Γöé
  212.      Γöé Returns            Γöé                          Γöé
  213.      Γöé Notes              Γöé                          Γöé
  214.      Γöé Example Code       Γöé                          Γöé
  215.      Γöé Related Functions  Γöé                          Γöé
  216.      Γöé Glossary           Γöé                          Γöé
  217.      Γöé                    Γöé                          Γöé
  218.      ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  219.  
  220.  The window on the left is the primary window. It contains a list of items that 
  221.  are always available to you. The window on the right is the secondary window. 
  222.  It contains a "snapshot" of the unit information. For reference units (that 
  223.  is, function descriptions), this window contains the Function Syntax. 
  224.  
  225.  All of the information needed to understand a reference unit (or topic) is 
  226.  readily available to you through the primary window. The information is 
  227.  divided into discrete information groups, and only the appropriate information 
  228.  group appears for the topic that you are viewing. 
  229.  
  230.  The information groups for a reference unit (that is, a function description) 
  231.  can include all or some of the following: 
  232.  
  233.      Syntax 
  234.      Parameters 
  235.      Returns 
  236.      Errors 
  237.      Notes 
  238.      Example Code 
  239.      Related Functions 
  240.      Graphic Elements and Orders 
  241.      Glossary 
  242.  
  243.  This list may vary. Some topics may be omitted when they do not apply. 
  244.  
  245.  Information groups are displayed in separate viewports that are stacked in a 
  246.  third window location that overlaps the secondary window. By selecting an item 
  247.  (information group) in the primary window, the item is displayed in the third 
  248.  window location, as follows: 
  249.  
  250.    ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  251.    Γöé Unit Title     Γöé   Selection Γöé   Glossary       Γöé
  252.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  253.    Γöé Select an item Γöé             Γöé Select a startingΓöé
  254.    Γöé                Γöé             Γöé letter of        Γöé
  255.    Γöé    .           Γöé             Γöé glossary terms   Γöé
  256.    Γöé    .           Γöé             Γöé                  Γöé
  257.    Γöé    .           Γöé             Γöé A    N           Γöé
  258.    Γöé    .           Γöé             Γöé B    O           Γöé
  259.    Γöé    .           Γöé             Γöé C    P           Γöé
  260.    Γöé Glossary       Γöé             Γöé .    .           Γöé
  261.    Γöé                Γöé             Γöé .    .           Γöé
  262.    Γöé                Γöé             Γöé .    .           Γöé
  263.    Γöé                Γöé             Γöé M    Z           Γöé
  264.    ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  265.  
  266.  By selecting successive items from the primary window, additional windows are 
  267.  displayed on top of the previous windows displayed in the third window 
  268.  location. For example, in a function description, Parameters and Return Values 
  269.  are items listed in the primary window. When selected, they appear one on top 
  270.  of the other in the third window location. Because of this, you may move the 
  271.  first selected (topmost) window to the left before selecting the next item. 
  272.  This allows simultaneous display of two related pieces of information from the 
  273.  "stack" of windows in the third window location, as follows: 
  274.  
  275.    ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  276.    Γöé Unit Title     Γöé  Parameters  Γöé  Return Values  Γöé
  277.    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  278.    Γöé Select an item Γöé              Γöé                 Γöé
  279.    Γöé    .           Γöé              Γöé                 Γöé
  280.    Γöé    .           Γöé              Γöé                 Γöé
  281.    Γöé    .           Γöé              Γöé                 Γöé
  282.    Γöé Returns        Γöé              Γöé                 Γöé
  283.    Γöé Errors         Γöé              Γöé                 Γöé
  284.    Γöé    .           Γöé              Γöé                 Γöé
  285.    Γöé    .           Γöé              Γöé                 Γöé
  286.    Γöé    .           Γöé              Γöé                 Γöé
  287.    Γöé                Γöé              Γöé                 Γöé
  288.    ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  289.  
  290.  Each window can be individually closed from its system menu. All windows are 
  291.  closed when you close the primary window. 
  292.  
  293.  Some secondary windows may have the appearance of a split screen. For example, 
  294.  an illustration may appear in the left half of the window, and scrollable, 
  295.  explanatory information may appear in the right half of the window. Because 
  296.  illustrations may not necessarily fit into the small window size on your 
  297.  screen, you may maximize the secondary window for better readability. 
  298.  
  299.  
  300. ΓòÉΓòÉΓòÉ 2.1. Conventions Used in this Reference ΓòÉΓòÉΓòÉ
  301.  
  302. The purpose of this reference is to give information about functions, 
  303. constants, and data types. It provides information about the functions which 
  304. enables the user to call functions in the C programming language. 
  305.  
  306. The following information is provided: 
  307.  
  308.      The syntax and parameters for each function. 
  309.      The syntax of each data type and structure 
  310.  
  311.  
  312. ΓòÉΓòÉΓòÉ 2.2. Notation Conventions ΓòÉΓòÉΓòÉ
  313.  
  314. The following notation conventions are used in this reference: 
  315.  
  316.  NULL                  The term NULL applied to a parameter is used to indicate 
  317.                        the presence of the pointer parameter, but with no 
  318.                        value. 
  319.  
  320.  NULLHANDLE            The term NULLHANDLE applied to a parameter is used to 
  321.                        indicate the presence of the handle parameter, but with 
  322.                        no value. 
  323.  
  324.  Implicit Pointer      If no entry for a data type "Pxxxxxxx" is found in Data 
  325.                        Types, then it is implicitly a pointer to the data type 
  326.                        "xxxxxxx". See Implicit Pointer Data Types for more 
  327.                        information about implicit pointers. 
  328.  
  329.  Constant Names        All constants are written in uppercase to match the 
  330.                        header files. Where applicable, constant names have a 
  331.                        prefix derived from the name of a function, message, or 
  332.                        idea associated with the constant. For example: 
  333.  
  334.                        WM_CREATE          Window message 
  335.                        SV_CXICON          System value 
  336.                        CF_TEXT            Clipboard format. 
  337.  
  338.                        In this reference, references to a complete set of 
  339.                        constants with the same prefix is written as shown in 
  340.                        the following examples: 
  341.  
  342.                        Window message       WM_* 
  343.                        System value         SV_* 
  344.  
  345.  Parameters and Fields Function parameters and data structure fields are shown 
  346.                        in italics. 
  347.  
  348.  
  349. ΓòÉΓòÉΓòÉ 2.3. Conventions Used in Function Descriptions ΓòÉΓòÉΓòÉ
  350.  
  351. The documentation of each function contains the following sections: 
  352.  
  353.  Syntax 
  354.       The function syntax describes the C-language calling syntax of the 
  355.       function and gives a brief description. 
  356.  
  357.       Programming Note 
  358.                         The functions in this book are spelled in mixed-case 
  359.                         for readability but are known to the system as 
  360.                         uppercase character strings. For example, the function 
  361.                         "GPIBeginArea" is actually the external name 
  362.                         "GPIBEGINAREA". 
  363.  
  364.       If you are using a compiler that generates a mixed-case external name, 
  365.       you should code the functions in uppercase. 
  366.  
  367.  Parameters 
  368.       Each parameter is listed with its C-language data type, parameter type, 
  369.       and a brief description. 
  370.  
  371.           All data types are written in uppercase to match the header files. A 
  372.            data type of "Pxxxxxxx" implicitly defines a pointer to the data 
  373.            type "xxxxxxx". 
  374.  
  375.            The term NULL applied to a parameter indicates the presence of the 
  376.            parameter, with no value. 
  377.  
  378.            Refer to Data Types for a complete list of all data types and their 
  379.            descriptions. 
  380.  
  381.           There are three parameter types: 
  382.  
  383.            Input              Specified by the programmer. 
  384.            Output             Returned by the function. 
  385.            Input/Output       Specified by the programmer and modified by the 
  386.                               function. 
  387.  
  388.           A brief description is provided with each parameter. Where 
  389.            appropriate, restrictions are also included. In some cases, the 
  390.            parameter points to a structure. 
  391.  
  392.  Returns 
  393.       A list of possible return codes or errors (when appropriate) is included 
  394.       in this section. Some functions do not have return codes. Refer to Error 
  395.       Number and Name for a list of error codes and their numerical values, and 
  396.       Error Name and Explanation for a list of error codes and their 
  397.       descriptions. 
  398.  
  399.  Remarks 
  400.       This section contains additional information about the function, when 
  401.       required. 
  402.  
  403.  Related Functions 
  404.       This list shows the functions (if any) that are related to the function 
  405.       being described. 
  406.  
  407.  Example Code 
  408.       An example of how the function can be used is shown in C language. 
  409.  
  410.  
  411. ΓòÉΓòÉΓòÉ 2.4. Error Severities ΓòÉΓòÉΓòÉ
  412.  
  413. Each of the error conditions given in the list of errors for each function 
  414. falls into one of these areas: 
  415.  
  416.  Warning 
  417.     The function detected a problem, but took some remedial action that enabled 
  418.     the function to complete successfully. The return code in this case 
  419.     indicates that the function completed successfully. 
  420.  
  421.  Error 
  422.     The function detected a problem for which it could not take any sensible 
  423.     remedial action. The system has recovered from the problem, and the state 
  424.     of the system, with respect to the application, remains the same as at the 
  425.     time when the function was requested. The system has not even partially 
  426.     executed the function (other than reporting the error). 
  427.  
  428.  Severe Error 
  429.     The function detected a problem from which the system could not reestablish 
  430.     its state, with respect to the application, at the time when that function 
  431.     was requested; that is, the system partially executed the function. This 
  432.     necessitates the application performing some corrective activity to restore 
  433.     the system to some known state. 
  434.  
  435.  Unrecoverable Error 
  436.     The function detected some problem from which the system could not 
  437.     re-establish its state, with respect to the application, at the time when 
  438.     that call was issued. It is possible that the application cannot perform 
  439.     some corrective action to restore the system to some known state. 
  440.  
  441.  The WinGetLastError and WinGetErrorInfo functions can be used to find out more 
  442.  about an error (or warning) that occurs as a result of executing a call. 
  443.  
  444.  
  445. ΓòÉΓòÉΓòÉ 2.5. Header Files ΓòÉΓòÉΓòÉ
  446.  
  447. All functions require an "#include" statement for the system header file OS2.H: 
  448.  
  449.  
  450. Uses Os2PmApi;
  451.  
  452. Most functions also require a "#define" statement to select an appropriate 
  453. (conditional) section of the header file, and hence, the required prototype. 
  454. Where this is necessary, it is shown at the head of the function definition in 
  455. the form: 
  456.  
  457.  
  458. Uses Os2Def;
  459.  
  460. Note:  These "#define" statements must precede the "#include <OS2.H>" 
  461.        statement. 
  462.  
  463.  
  464. ΓòÉΓòÉΓòÉ 2.6. Addressing Elements in Arrays ΓòÉΓòÉΓòÉ
  465.  
  466. Constants defining array elements are given values that are zero-based in C; 
  467. that is, the numbering of the array elements starts at zero, not one. 
  468.  
  469. For example, in the DevQueryCaps function, the sixth element of the alArray 
  470. parameter is CAPS_HEIGHT, which is equated to 5. 
  471.  
  472. Count parameters related to such arrays always mean the actual number of 
  473. elements available; therefore, again using the DevQueryCaps function as an 
  474. example, if all elements up to and including CAPS_HEIGHT are provided for, 
  475. lCount could be set to (CAPS_HEIGHT+1). 
  476.  
  477. In functions for which the starting array element can be specified, this is 
  478. always zero-based, and so the C element number constants can be used directly. 
  479. For example, to start with the CAPS_HEIGHT element, the DevQueryCaps parameter 
  480. can be set to CAPS_HEIGHT. 
  481.  
  482.  
  483. ΓòÉΓòÉΓòÉ 2.7. Implicit Pointer Data Types ΓòÉΓòÉΓòÉ
  484.  
  485. A data type name beginning with "P" (for example, PERRORCODE) is likely to be a 
  486. pointer to another data type (in this instance, ERRORCODE). 
  487.  
  488. In the data type summary, Data Types, no explicit "typedefs" are shown for 
  489. pointers; therefore, if no data type definition can be found in the summary for 
  490. a data type name "Pxxxxxx", it represents a pointer to the data type "xxxxxx", 
  491. for which a definition should be found in the reference. 
  492.  
  493. The implicit type definition needed for such a pointer "Pxxxxxx" is: 
  494.  
  495.  
  496. Type
  497.   Pxxxxxx = ^xxxxxx
  498.  
  499. Such definitions are provided in the header files. OS2.H. 
  500.  
  501.  
  502. ΓòÉΓòÉΓòÉ 2.8. Storage Mapping of Data Types ΓòÉΓòÉΓòÉ
  503.  
  504. The storage mapping of the data types is dependent on the machine architecture. 
  505. To be portable, applications must access the data types using the definitions 
  506. supplied for the environment in which they will execute. 
  507.  
  508.  
  509. ΓòÉΓòÉΓòÉ 2.9. Double-Byte Character Set (DBCS) ΓòÉΓòÉΓòÉ
  510.  
  511. Throughout this publication, you will see references to specific value for 
  512. character strings. The values are for single-byte character set (SBCS). If you 
  513. use the double-byte character set (DBCS), note that one DBCS character equals 
  514. two SBCS characters. 
  515.  
  516.  
  517. ΓòÉΓòÉΓòÉ 2.10. Programming Considerations ΓòÉΓòÉΓòÉ
  518.  
  519. This section provides information you need to consider before you begin 
  520. programming with GPI functions. 
  521.  
  522.  
  523. ΓòÉΓòÉΓòÉ 2.10.1. Stack Size ΓòÉΓòÉΓòÉ
  524.  
  525. Existing 16-bit applications (small and tiny models) must have a 4KB stack 
  526. available when they enter system calls; otherwise, the stack can overflow into 
  527. the data area. 
  528.  
  529.  
  530. ΓòÉΓòÉΓòÉ 2.10.2. Presentation Manager ΓòÉΓòÉΓòÉ
  531.  
  532. The Presentation Manager component of the OS/2* operating system is based on 
  533. the IBM Systems Application Architecture* (SAA*) Common Programming Interface-a 
  534. an architecture for the design and development of applications. 
  535.  
  536. The Presentation Manager component implements the Common User Access* (CUA*) 
  537. interface, which you can use to attain consistency in the appearance and 
  538. behavior of your applications. 
  539.  
  540.  
  541. ΓòÉΓòÉΓòÉ 2.10.3. C++ Considerations ΓòÉΓòÉΓòÉ
  542.  
  543. This section contains several topics you should take into consideration if you 
  544. are using C++ **. 
  545.  
  546.  
  547. ΓòÉΓòÉΓòÉ 2.10.3.1. C++ Header Files ΓòÉΓòÉΓòÉ
  548.  
  549. OS/2 functions that used to take a PSZ as a parameter, and that do not modify 
  550. the contents of the passed string, have been updated in the C++ header files to 
  551. take a PCSZ data type parameter. The use of PCSZ allows for better optimization 
  552. by the compiler and is more semantically compatible with C++. Existing code 
  553. that calls functions that use PSZ will continue to work correctly. 
  554.  
  555. Several of the typedefs have been changed in the C++ header files. For example, 
  556. many items that are unsigned char in the C header files are char in the C++ 
  557. header files. For instance, 
  558.  
  559.  
  560. Type
  561.  
  562. Not defined
  563.  
  564. has changed to 
  565.  
  566.  
  567. Not defined
  568.  
  569. The existing samples that are included in the IBM Developer's Toolkit for OS/2 
  570. Warp, Version 3 can be used with either set of the header files. 
  571.  
  572.  
  573. ΓòÉΓòÉΓòÉ 2.10.3.2. PCSZ Data Type ΓòÉΓòÉΓòÉ
  574.  
  575. Note:  The PCSZ data type is defined in the C++ header files included with this 
  576.        product. The use of the "const" keyword is not necessarily specific to 
  577.        C++. Certain C compilers support it as well. 
  578.  
  579.  If a function takes as a parameter a string that is not changed by the 
  580.  function, the string parameter can be declared as a "const" string, or a PCSZ. 
  581.  PCSZ is defined in the C++ header files as a "const" pointer to a 
  582.  NULL-delimited string. The "const" means that the function will not change the 
  583.  contents of the string. 
  584.  
  585.  Declaring the parameter as PCSZ informs the C++ compiler that the function 
  586.  will not change the string. Therefore, the compiler simply passes a pointer to 
  587.  the string in the function parameter list. If the parameter is declared as a 
  588.  normal PSZ (not "const"), the compiler assumes that the function might change 
  589.  the string. Under these circumstances the compiler will add code to make a 
  590.  copy of the string then pass a pointer to the copy, rather than pass a pointer 
  591.  to the original string. 
  592.  
  593.  A smaller, faster executable is often produced if the data item passed in a 
  594.  parameter list is declared as "const". 
  595.  
  596.  If the data item is declared as "const" then it must not be changed by the 
  597.  function. 
  598.  
  599.  
  600. ΓòÉΓòÉΓòÉ 2.10.3.3. LINK386 ΓòÉΓòÉΓòÉ
  601.  
  602. The C++ compiler will provide a dynamic link library which is be used by 
  603. LINK386 when generating error messages. This DLL will convert a compiler 
  604. generated mangled name into the function prototype. If the DLL is not present, 
  605. an error message will be displayed and LINK386 will display the 
  606. compiler-generated mangled name in error messages.