home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / VSCPPv4.zip / VACPP / IBMCPP / HELP / CPPHDI.INF (.txt) < prev    next >
OS/2 Help File  |  1995-05-23  |  163KB  |  3,984 lines

  1.  
  2. ΓòÉΓòÉΓòÉ <hidden> About this Information ΓòÉΓòÉΓòÉ
  3.  
  4. The How Do I... information provides solutions to common tasks that you would 
  5. perform with the various components of VisualAge C++. Before you begin to use 
  6. this information, it would be helpful to understand how to navigate through it: 
  7.  
  8.      Use the Contents and Index facilities to locate topics. 
  9.      Use the Search facility to search the text of this document. 
  10.      Use hypertext links to acquire related information on the current topic. 
  11.       Hypertext links appear in a different color (which you can customize 
  12.       using the OS/2 Scheme Palette). For example, below there are two lists of 
  13.       hypertext links. By double-clicking on the text of the link or by 
  14.       pressing Enter on a highlighted link, you will open a panel of related 
  15.       information. To shift the focus to other links using the keyboard, use 
  16.       the Tab key. 
  17.  
  18.  For more information on using this help facility, see: 
  19.  
  20.      How to Use the Contents 
  21.      How to Obtain Additional Information 
  22.      How to Access and Use IPF Facilities 
  23.  
  24.  For more information, see: 
  25.  
  26.      Other Information You Might Find Helpful 
  27.      Communicating Your Comments to IBM 
  28.      Notices 
  29.      Trademarks 
  30.  
  31.  
  32. ΓòÉΓòÉΓòÉ <hidden> How to Use the Contents ΓòÉΓòÉΓòÉ
  33.  
  34. The Contents window is the first to appear. Some topics have a plus ( ) icon 
  35. beside them. This icon indicates that additional topics are available. 
  36.  
  37. To expand the Contents if you are using a mouse, click on the plus ( ) icon. If 
  38. you are using the keyboard, use the Up or Down Arrow key to highlight the 
  39. topic, and press the plus (+) key. To see additional topics for a heading with 
  40. a plus ( ) icon, click on the icon or highlight that topic and press the plus 
  41. (+) key. 
  42.  
  43. To view a topic, double-click on the topic (or press the Up or Down Arrow key 
  44. to highlight the topic, and then press the Enter key). 
  45.  
  46.  
  47. ΓòÉΓòÉΓòÉ <hidden> How to Obtain Additional Information ΓòÉΓòÉΓòÉ
  48.  
  49. After you select a topic, the information for that topic appears in a window. 
  50. Highlighted words or phrases indicate that additional information is available. 
  51. Certain words and phrases are highlighted in a different color from the 
  52. surrounding text. These are called hypertext terms. 
  53.  
  54. If you are using a mouse, double-click on the highlighted word. If you are 
  55. using a keyboard, press the Tab key to move to the highlighted word, and then 
  56. press the Enter key. Additional information then appears in a window. 
  57.  
  58.  
  59. ΓòÉΓòÉΓòÉ <hidden> How to Access and Use IPF Facilities ΓòÉΓòÉΓòÉ
  60.  
  61. Several choices are available for managing the information presented in this 
  62. document. There are three PullDown menus: the Services menu, the Options menu, 
  63. and the Help menu. 
  64.  
  65. The actions that are selectable from the Services menu operate on the active 
  66. window currently displayed on the screen. These actions include the following: 
  67.  
  68.  Placing Bookmarks 
  69.    You can set a placeholder so you can retrieve information of interest to 
  70.    you. 
  71.  
  72.  Searching for Information 
  73.    You can find occurrences of a word or phrase in the current topic, selected 
  74.    topics, or all topics. 
  75.  
  76.  Printing Information 
  77.    You can print one or more topics. You can also print a set of topics by 
  78.    first marking the topics in the Contents list. 
  79.  
  80.  Copying Information to a File 
  81.    You can copy a topic that you are viewing to the System Clipboard or to a 
  82.    file that you can edit. This method is particularly useful for copying 
  83.    syntax definitions and program samples into the application that you are 
  84.    developing. 
  85.  
  86.  Using the actions that are selectable from the Options menu, you can change 
  87.  the way your Contents list is displayed. To expand the Contents and show all 
  88.  levels for all topics, choose Expand all from the Options PullDown menu. You 
  89.  can also press the Ctrl, Shift and * keys together. 
  90.  
  91.  The actions that are selectable from the Help menu allow you to select 
  92.  different types of help information. 
  93.  
  94.  For information about any of the menu choices, highlight the choice in the 
  95.  menu and press F1. 
  96.  
  97.  
  98. ΓòÉΓòÉΓòÉ <hidden> Placing Bookmarks ΓòÉΓòÉΓòÉ
  99.  
  100. When you place a bookmark on a topic, it is added to a list of bookmarks you 
  101. have previously set.  You can view the list, and you can remove one or all 
  102. bookmarks from the list.  If you have not set any bookmarks, the list is empty. 
  103.  
  104. To set a bookmark, do the following: 
  105.  
  106.    1. Select a topic from the Contents. 
  107.    2. When that topic appears, select the Bookmark option from the Services 
  108.       menu. 
  109.    3. If you want to change the name used for the bookmark, type the new name 
  110.       in the field. 
  111.    4. Click on the Place radio button (or press the Up or Down Arrow key to 
  112.       select it). 
  113.    5. Click on OK (or select it and press Enter). The bookmark is then added to 
  114.       the bookmark list. 
  115.  
  116.  
  117. ΓòÉΓòÉΓòÉ <hidden> Searching for Information ΓòÉΓòÉΓòÉ
  118.  
  119. You can specify a word or phrase to be searched.  You can also limit the search 
  120. to a set of topics by first marking the topics in the Contents list. 
  121.  
  122. To search for a word or phrase in all topics, do the following: 
  123.  
  124.    1. Select the Search option from the Services menu. 
  125.    2. Type the word or words to be searched for. 
  126.    3. Click on All sections (or press the Up or Down Arrow keys to select it). 
  127.    4. Click on Search (or select it and press Enter) to begin the search. 
  128.    5. The list of topics where the word or phrase appears is displayed. 
  129.  
  130.  
  131. ΓòÉΓòÉΓòÉ <hidden> Printing Information ΓòÉΓòÉΓòÉ
  132.  
  133. You can print one or more topics, the index, or the table of contents.  Make 
  134. sure that your printer is connected to the serial port, configured correctly, 
  135. and ready for input. To print: 
  136.  
  137.    1. Select Print from the Services menu. 
  138.    2. Select what you want to print. Note that the This section and Marked 
  139.       sections choices are only available if you are viewing a topic or if you 
  140.       have marked topics, respectively.  To mark topics in the table of 
  141.       contents, press the Ctrl key and click on the topics, or use the arrow 
  142.       keys. 
  143.    3. Select Print to print what you've chosen on your printer. 
  144.  
  145.  
  146. ΓòÉΓòÉΓòÉ <hidden> Copying Information to a File ΓòÉΓòÉΓòÉ
  147.  
  148. You can copy a topic that you are viewing in two ways: 
  149.  
  150.      Copy copies the topic that you are viewing into the System Clipboard. If 
  151.       you are using a Presentation Manager (PM) editor (for example, the 
  152.       Enhanced Editor) that copies or cuts (or both) to the System Clipboard, 
  153.       and pastes to the System Clipboard, you can easily add the copied 
  154.       information to your program source module. 
  155.  
  156.      Copy to file copies the topic that you are viewing into a temporary file 
  157.       named TEXT.TMP. You can later edit that file by using any editor. 
  158.       TEXT.TMP is placed in the directory where your viewable document resides. 
  159.  
  160.  To copy a topic, do the following: 
  161.  
  162.    1. Expand the Contents list and select a topic. 
  163.    2. When the topic appears, select Copy to file from the Services menu. 
  164.    3. The system puts the text pertaining to that topic into the temporary file 
  165.       TEXT.TMP. 
  166.  
  167.  
  168. ΓòÉΓòÉΓòÉ <hidden> Other Information You Might Find Helpful ΓòÉΓòÉΓòÉ
  169.  
  170. The VisualAge C++ provides a number of online guides and references that we 
  171. hope you'll find helpful as you develop applications. This information 
  172. includes: 
  173.  
  174.      User's Guide information provides conceptual and usage information, 
  175.      Reference information is organized for quick access, and 
  176.      How Do I... information gives you specific instructions for performing 
  177.       common tasks. 
  178.  
  179.  You can get to this online information from the Information folder inside the 
  180.  main product folder. You can also get to it from the Help menu in any of the 
  181.  components of the product. 
  182.  
  183.  
  184. ΓòÉΓòÉΓòÉ <hidden> Communicating Your Comments to IBM ΓòÉΓòÉΓòÉ
  185.  
  186. If there is something you like, or dislike, about this document, please let us 
  187. know. You can use one of the methods listed below to send your comments to IBM. 
  188. Please be sure to include the complete title of the publication that you are 
  189. commenting on. For example, you would refer to the How Do I... information for 
  190. the Browser as: 
  191.   VisualAge C++ Browser: How Do I... for OS/2. 
  192.  
  193. The comments you send should only pertain to the information in this document 
  194. and its presentation. To request additional publications or to ask questions or 
  195. make comments about the functions of IBM products or systems, you should talk 
  196. to your IBM representative or your authorized IBM remarketer. 
  197.  
  198. When you send comments to IBM, you grant IBM a nonexclusive right to use or 
  199. distribute your comments in any way it believes appropriate without incurring 
  200. any obligation to you. 
  201.  
  202. You can send your comments to IBM in the following ways: 
  203.  
  204.      By mail to the following address: 
  205.  
  206.             IBM Canada Ltd. Laboratory
  207.             Information Development
  208.             2G/345/1150/TOR
  209.             1150 EGLINTON AVENUE EAST
  210.             NORTH YORK, ONTARIO
  211.             CANADA M3C 1H7
  212.  
  213.      By FAX to the following number: 
  214.  
  215.         -  United States and Canada: (416) 448-6161 
  216.         -  Other countries (+1) 416-448-6161 
  217.  
  218.      By electronic mail to one of the following IDs.  Be sure to include your 
  219.       entire network address if you wish to get a reply. 
  220.  
  221.         -  Internet: torrcf@vnet.ibm.com 
  222.         -  IBMLink: toribm(torrcf) 
  223.         -  IBM/PROFS: torolab4(torrcf) 
  224.         -  IBMMAIL: ibmmail(caibmwt9 
  225.  
  226.  
  227. ΓòÉΓòÉΓòÉ <hidden> Notices ΓòÉΓòÉΓòÉ
  228.  
  229. Copyright International Business Machines Corporation, 1995. All rights 
  230. reserved. 
  231.  
  232. Note to U.S. Government Users - Documentation related to restricted rights - 
  233. Use, duplication, or disclosure is subject to restrictions set forth in GSA ADP 
  234. Schedule Contract with IBM Corp. 
  235.  
  236. This edition applies to Version 3.0 of IBM VisualAge C++ for OS/2 (30H1664, 
  237. 30H1665, 30H1666) and to all subsequent releases and modifications until 
  238. otherwise indicated in new editions.  Make sure you are using the correct 
  239. edition for the level of the product. 
  240.  
  241. This publication could include technical inaccuracies or typographical errors. 
  242. Changes are periodically made to the information herein; any such changes will 
  243. be reported in subsequent revisions. 
  244.  
  245. Requests for publications and for technical information about IBM products 
  246. should be made to your IBM Authorized Dealer or your IBM Marketing 
  247. Representative. 
  248.  
  249. When you send information to IBM, you grant IBM a nonexclusive right to use or 
  250. distribute the information in any ways it believes appropriate without 
  251. incurring any obligation to you. 
  252.  
  253. Any reference to an IBM licensed program in this publication is not intended to 
  254. state or imply that only IBM's licensed program may be used. Any functionally 
  255. equivalent product, program, or service that does not infringe any of IBM's 
  256. intellectual property rights may be used instead of the IBM product, program, 
  257. or service. Evaluation and verification of operation in conjunction with other 
  258. products, except  those expressly designated by IBM, is the user's 
  259. responsibility. 
  260.  
  261. IBM may have patents or pending patent applications covering subject matter in 
  262. this document.  The furnishing of this document does not give you any license 
  263. to these patents.  You can send license inquiries, in writing, to the IBM 
  264. Director of Licensing. IBM Corporation, 500 Columbus Avenue, Thornwood, NY, 
  265. 10594, USA. 
  266.  
  267. This publication contains examples of data and reports used in daily business 
  268. operations. To illustrate them as completely as possible, the examples include 
  269. the names of individuals, companies, brands, and products. All of these names 
  270. are fictitious and any similarity to the names and addresses used by an actual 
  271. business enterprise is entirely coincidental. 
  272.  
  273.  
  274. ΓòÉΓòÉΓòÉ <hidden> Trademarks and Service Marks ΓòÉΓòÉΓòÉ
  275.  
  276. The following terms used in this publication are trademarks or service marks of 
  277. IBM Corporation in the United States or other countries: 
  278.  
  279.  C/2                      C Set/2 
  280.  C Set ++                 Common User Access 
  281.  CUA                      IBM 
  282.  Operating System/2       OS/2 
  283.  Personal System/2        Presentation Manager 
  284.  PS/2                     VisualAge 
  285.  WorkFrame/2 
  286.  
  287.  Other company, product, and service names, which may be denoted by a double 
  288.  asterisk(**), may be trademarks or service marks of others. 
  289.  
  290.  
  291. ΓòÉΓòÉΓòÉ 1. Access Help ΓòÉΓòÉΓòÉ
  292.  
  293. You can access the VisualAge C++ documentation in two ways: 
  294.  
  295.      Use the Help PullDown menu from any VisualAge C++ component, and select 
  296.       the VisualAge C++ Documentation Cascade menu, or 
  297.      Open the Information folder within the VisualAge C++ desktop folder and 
  298.       double-click on the information icon of your choice. 
  299.  
  300.  For a list of online information available for the VisualAge C++ product, 
  301.  select the ? PushButton on the How Do I... information ButtonBar below. 
  302.  
  303.  Related Tasks 
  304.  
  305.      How do I get support 
  306.  
  307.  
  308. ΓòÉΓòÉΓòÉ 2. Access VisualAge C++ Components ΓòÉΓòÉΓòÉ
  309.  
  310. You can access all components in three ways: 
  311.  
  312.      Double-click on the component's icon located in the Tools folder of the 
  313.       VisualAge C++ desktop folder. 
  314.      From the command line. (Double-click on a component listed below for 
  315.       syntax). 
  316.      If you have a WorkFrame project, from the Project PullDown menu on any 
  317.       component, or from the WorkFrame project icon PopUp menu. 
  318.  
  319.  Select one of the tools below for more information: 
  320.  
  321.      Browser 
  322.      Data Access Builder 
  323.      Debugger 
  324.      Editor 
  325.      Performance Analyzer 
  326.      Visual Builder 
  327.      WorkFrame 
  328.  
  329.  
  330. ΓòÉΓòÉΓòÉ 3. Add/Delete VisualAge C++ Components ΓòÉΓòÉΓòÉ
  331.  
  332. Once VisualAge C++ has been installed, you can go back to the install program 
  333. to install additional components or reinstall components that you have changed 
  334. or erased. You can also use the install program to remove VisualAge C++ 
  335. components or backup versions of components from your workstation. 
  336.  
  337.    1. Open the Tools folder located in the VisualAge C++ desktop folder. 
  338.    2. Double-click on the Installation Utility icon. The VisualAge C++ 
  339.       Installation and Instruction windows appear. 
  340.    3. Select the Continue PushButton in the Instruction window. The 
  341.       Installation Options window appears showing three options (double-click 
  342.       on an option below for more information): 
  343.           Update the currently installed components 
  344.           Delete the installed components and re-install 
  345.           Install additional components 
  346.  
  347.  For more details, see the Read Me First booklet. 
  348.  
  349.  
  350. ΓòÉΓòÉΓòÉ <hidden> Updating the currently installed components ΓòÉΓòÉΓòÉ
  351.  
  352. Use this procedure to overwrite all currently installed components with the 
  353. installation files. Warning: This option updates everything you have installed; 
  354. you cannot choose individual components to update. 
  355.  
  356.    1. Choose Update the currently installed components and select the Continue 
  357.       PushButton. The Update window appears. 
  358.    2. Choose whether you want to have your config.sys automatically updated and 
  359.       whether you want to save a backup version of this installation in case 
  360.       you ever need to restore it. 
  361.    3. Select the Update PushButton. 
  362.    4. Select the Yes PushButton on any information dialogs that may appear. 
  363.    5. A Progress window shows the status of the update process. When all the 
  364.       components files and related information have been updated, a message box 
  365.       appears. Select the OK PushButton. 
  366.    6. Select the Exit PushButton from the VisualAge C++ Installation window. 
  367.  
  368.  
  369. ΓòÉΓòÉΓòÉ <hidden> Deleting the installed components and re-install ΓòÉΓòÉΓòÉ
  370.  
  371. Use this procedure to delete the installed components, including their desktop 
  372. objects and any entries in any .INI files. You can then reinstall them if you 
  373. like. 
  374.  
  375.    1. Choose Delete the installed components and re-install and select the 
  376.       Continue PushButton. 
  377.    2. Select the components that you want to delete. Use the Select All 
  378.       PushButton to choose all components. 
  379.    3. Select the Delete PushButton. 
  380.    4. A Progress window shows the status of the deletion process. When all 
  381.       selected components have been deleted, a message box appears. Select the 
  382.       OK PushButton. 
  383.    5. Select the Exit PushButton from the VisualAge C++ Installation window. 
  384.  
  385.  
  386. ΓòÉΓòÉΓòÉ <hidden> Installing additional components ΓòÉΓòÉΓòÉ
  387.  
  388. Use this procedure to install components that are not already installed. 
  389.  
  390.    1. Choose Install additional components and select the Continue PushButton. 
  391.       The Installation window appears. 
  392.    2. Choose whether you want to have your config.sys automatically updated and 
  393.       whether to overwrite existing files. 
  394.    3. Select the OK PushButton. The Install - directories window appears 
  395.       listing only the components that you have not yet installed. 
  396.    4. Select the components that you want to install. 
  397.    5. Select the Install PushButton. 
  398.    6. A Progress window shows the status of the installation process. When all 
  399.       selected components have been installed, a message box appears. Select 
  400.       the OK PushButton. 
  401.    7. Select the Exit PushButton from the VisualAge C++ Installation window. 
  402.    8. Reboot your system to make the changes to the config.sys file take 
  403.       effect. Note that if you did not have your config.sys file automatically 
  404.       updated, then first make the appropriate changes based on the config.add 
  405.       file that was created by the installation process. Also, if you chose to 
  406.       install WorkFrame, a second phase of installation will begin when you 
  407.       reboot. This can be run in the background by selecting the Hide 
  408.       PushButton from the second phase installation window. 
  409.  
  410.  
  411. ΓòÉΓòÉΓòÉ 4. Analyze Performance ΓòÉΓòÉΓòÉ
  412.  
  413. The Performance Analyzer is an OS/2 based application that helps you improve 
  414. and understand the behavior of IBM C/C++ applications. 
  415.  
  416. The Performance Analyzer traces the execution of your application and creates a 
  417. trace file.  The trace file contains trace analysis data that can be displayed 
  418. in diagrams.  Using these diagrams, you can improve the performance of an 
  419. application, determine what led to certain faults, and in general, understand 
  420. what happens when your application runs. 
  421.  
  422. The Performance Analyzer does not replace static analyzers or debuggers, but it 
  423. can complement them by helping you understand aspects of the application that 
  424. would otherwise be difficult or impossible to see. 
  425.  
  426. To start the Performance Analyzer: 
  427.  
  428.      Double-click on the Performance Analyzer icon found in the Tools folder 
  429.       which is located in the VisualAge C++ desktop folder. 
  430.      From the WorkFrame project environment, select Analyze from the WorkFrame 
  431.       PullDown menu. 
  432.      If you use a WorkFrame project to access another component of VisualAge 
  433.       C++, then select Analyze from the Project PullDown menu. 
  434.  
  435.  Related Information: 
  436.  
  437.      The Performance Analyzer How Do I... information 
  438.      The Performance Analyzer section of the User's Guide 
  439.  
  440.  
  441. ΓòÉΓòÉΓòÉ 5. Browse my Files ΓòÉΓòÉΓòÉ
  442.  
  443. The Browser lets you look at your source files in many different ways: 
  444.  
  445.      List program objects by type, content or component 
  446.      Graph relationships between program objects 
  447.      Load the target of a project without recompiling 
  448.      View and edit the source code 
  449.      View online documentation for a class or a class member. 
  450.  
  451.  You can start the Browser from several places: 
  452.  
  453.      The OS/2 Command Prompt 
  454.      The OS/2 Workplace Shell 
  455.      The WorkFrame environment 
  456.      The Debugger or Editor 
  457.  
  458.  Related Tasks: 
  459.  
  460.      How do I compile for browsing 
  461.      How do I link for browsing 
  462.  
  463.  Related Information: 
  464.  
  465.      The Browser How Do I... information 
  466.      The Browser section of the User's Guide 
  467.  
  468.  
  469. ΓòÉΓòÉΓòÉ <hidden> Starting the Browser from the OS/2 Command Prompt ΓòÉΓòÉΓòÉ
  470.  
  471. To start the Browser from the command line, type: 
  472.  
  473.    icsbrs [file_name]
  474.  
  475.  Where file_name can be a Browser database file (with extension .PDB, .PDD, 
  476.       .PDE, .PDL) or a program file that has been linked with the /BROWSE 
  477.       option (with extension .DLL, .EXE, .LIB). Note that you can also load 
  478.       multiple .PDB file names and merge multiple file types. See the User's 
  479.       Guide section on Merging Files into the Browser. 
  480.  
  481.  If you type icsbrs without a file name, you can use the Load Cascade menu on 
  482.  the File PullDown menu from the Browser user interface to load files. 
  483.  
  484.  Related Information: 
  485.  
  486.      The Browser How Do I... 
  487.  
  488.  
  489. ΓòÉΓòÉΓòÉ <hidden> Starting the Browser from the OS/2 Workplace Shell ΓòÉΓòÉΓòÉ
  490.  
  491. You can start the Browser from the OS/2 Workplace Shell in three ways: 
  492.  
  493.      Double-click on the Browser icon in the VisualAge C++ desktop folder. 
  494.      Double-click on a Browser database file (.PDB, .PDD, .PDE, or .PDL) from 
  495.       a Workplace Shell or WorkFrame folder. 
  496.      Drag a Browser database file or program file linked with the /BROWSE 
  497.       option (.DLL, .EXE, or .LIB) or WorkFrame project icon onto the Browser 
  498.       icon. 
  499.  
  500.  Related Information: 
  501.  
  502.      The Browser How Do I... 
  503.  
  504.  
  505. ΓòÉΓòÉΓòÉ <hidden> Starting the Browser from the WorkFrame environment ΓòÉΓòÉΓòÉ
  506.  
  507. To start the Browser from the WorkFrame environment, you can: 
  508.  
  509.      Double-click on a Browser database object (.PDB, .PDD, .PDE or .PDL) in 
  510.       any WorkFrame project folder, 
  511.      Select Browse from any WorkFrame project System menu to load a Browser 
  512.       session, or 
  513.      Select the Browse action from the PopUp on any Browser database object. 
  514.  
  515.  Related Information: 
  516.  
  517.      The Browser How Do I... 
  518.  
  519.  
  520. ΓòÉΓòÉΓòÉ <hidden> Starting the Browser from the Debugger or Editor ΓòÉΓòÉΓòÉ
  521.  
  522. To start the Browser from the Debugger: 
  523.  
  524.    1. Select the Project PullDown menu from the Debugger user interface. 
  525.    2. Select the Browse Cascade menu. 
  526.    3. Select a Browser action to perform on the program currently loaded into 
  527.       the Debugger or on a selected program element. 
  528.  
  529.  To start the Browser from the Editor: 
  530.  
  531.    1. Select the Browser PullDown menu from the Editor user interface. 
  532.    2. Select an action to perform on the file currently loaded or on a selected 
  533.       program element. 
  534.  
  535.  Related Information: 
  536.  
  537.      The Browser How Do I... 
  538.  
  539.  
  540. ΓòÉΓòÉΓòÉ 6. Change my config.sys File for VisualAge C++ ΓòÉΓòÉΓòÉ
  541.  
  542. If you chose not to have the installation program automatically update your 
  543. config.sys file, you must make changes to the environment variables it contains 
  544. before you can use VisualAge C++. If you are installing WorkFrame, you must 
  545. make these changes before the second phase of installation can begin. (The 
  546. second phase starts after you reboot your system). To make it easier for you, 
  547. the install program creates a file called config.add, which contains the 
  548. changes you will need to make. You can find config.add in the target install 
  549. directory. 
  550.  
  551. Note:  The CSETENV.CMD file in the BIN directory also contains the environment 
  552.        settings for VisualAge C++. You can run this command file before using 
  553.        VisualAge C++ in order to set the proper environment variables. Note 
  554.        that these changes will only be valid for the current OS/2 session. 
  555.  
  556.  
  557. ΓòÉΓòÉΓòÉ 7. Code in C and C++ ΓòÉΓòÉΓòÉ
  558.  
  559. The following are some topics on coding in C and C++: 
  560.  
  561.      Using & and * on pointers and arrays 
  562.      Handling exceptions 
  563.      Demangling (decode) a C++ function name 
  564.      Changing locale without recompiling 
  565.      Redirecting standard input/output streams 
  566.      Mixing old and new templates 
  567.      Creating a multithread program 
  568.  
  569.  For more information on coding in C and C++, see: 
  570.  
  571.      The Coding Your Program section of the Programming Guide, or 
  572.      The Language Reference 
  573.  
  574.  
  575. ΓòÉΓòÉΓòÉ 7.1. Using & and * on pointers and arrays ΓòÉΓòÉΓòÉ
  576.  
  577. Use the address operator (&) to return a pointer to the location of the 
  578. operand. Use the indirection operator (*) to access the data object that is 
  579. pointed to. 
  580.  
  581. For example, the following lines define pSample as a pointer to type int and a 
  582. as an int: 
  583.  
  584.    int *pSample;
  585.    int a;
  586.  
  587. and the following statements together assign the value 3 to a: 
  588.  
  589.    pSample = &a;  /* pSample points to variable a  */
  590.    *pSample = 3;  /* whatever pSample points to gets value 3 */
  591.  
  592. Related Information: 
  593.  
  594.      The Unary Expressions section of the Language Reference 
  595.  
  596.  
  597. ΓòÉΓòÉΓòÉ 7.2. Handling exceptions ΓòÉΓòÉΓòÉ
  598.  
  599. The VisualAge C++ product and the OS/2 operating system both have the 
  600. capability to detect and report runtime errors and abnormal conditions. 
  601. Abnormal conditions can be reported to you and handled in one of the following 
  602. ways: 
  603.  
  604.      Using VisualAge C++ signal handlers. Signals are a mechanism by which a 
  605.       process (thread) may be notified of, or affected by, an event occurring 
  606.       in the system. Error handling by signals can be used in both C and C++ 
  607.       programs. 
  608.      Using OS/2 exception handlers. Exceptions are any system, logic, or user 
  609.       error detected by a function that does not itself deal with the error but 
  610.       passes the error on to an exception handling routine. The VisualAge C++ 
  611.       library provides a C-language OS/2 exception handler, _Exception, to map 
  612.       OS/2 exceptions to C signals  and signal handlers. You can also create 
  613.       and use your own exception handlers. OS/2 exceptions and exception 
  614.       handlers are described in the Control Program Guide and Reference 
  615.       documentation. 
  616.      Using C++ exception handling constructs. These constructs belong to the 
  617.       C++ language definition and can only be used in C++ code. 
  618.  
  619.  Both signal and OS/2 exception handling are implemented in C++ as they are in 
  620.  C. 
  621.  
  622.  Note:  You should use the Debugger to debug exception handling problems, since 
  623.         complete notification and stack tracing are available through the 
  624.         Debugger. 
  625.  
  626.  The following topics are covered in this section: 
  627.  
  628.      Common problems that generate exception 
  629.      Handling OS/2 exceptions 
  630.      Creating your own OS/2 exception handlers 
  631.      Handling C++ exceptions 
  632.      Handling C/C++ signals 
  633.      Handling signals and OS/2 exceptions in DLLs 
  634.      OS/2 exceptions handling considerations 
  635.      Handling signals in a multithread program 
  636.  
  637.  Related Information: 
  638.  
  639.      The C++ Exception Handling section of the Language Reference 
  640.      The Signal and OS/2 Exception Handling section of the Programming Guide 
  641.  
  642.  
  643. ΓòÉΓòÉΓòÉ 7.2.1. Common problems that generate exceptions ΓòÉΓòÉΓòÉ
  644.  
  645. The following is a list of some of the common problems that can generate 
  646. runtime exceptions: 
  647.  
  648.      Improper use of memory. For example, using a pointer to an object that 
  649.       has already been freed can cause an exception, as can corrupting the 
  650.       heap. 
  651.  
  652.      Using an invalid pointer. 
  653.  
  654.      Passing an invalid parameter to a system function. 
  655.  
  656.      Return codes from library or system calls that are not checked. 
  657.  
  658.  
  659. ΓòÉΓòÉΓòÉ 7.2.2. Handling OS/2 exceptions ΓòÉΓòÉΓòÉ
  660.  
  661. An OS/2 exception is generated by the operating system to report an abnormal 
  662. condition. OS/2 exceptions are grouped into two categories: 
  663.  
  664.  Asynchronous exceptions 
  665.       Which are caused by actions outside of your current thread.  There are 
  666.       only two: 
  667.  
  668.           XCPT_SIGNAL, caused by a keyboard signal (Ctrl-C or Ctrl-Break) or 
  669.            the process termination exception. This exception can only occur on 
  670.            thread 1 of your process. 
  671.           XCPT_ASYNC_PROCESS_TERMINATE, caused by one of your threads 
  672.            terminating the entire process. This exception can occur on any 
  673.            thread. 
  674.  
  675.  Synchronous exceptions 
  676.       Which are caused by code in the thread that receives the exception. All 
  677.       other OS/2 exceptions fall into this category. 
  678.  
  679.  Just as you use signal handlers to handle signals, use exception handlers to 
  680.  handle OS/2 exceptions. Exception handling offers additional function, but 
  681.  signal handling is simpler, so you may want to use both. 
  682.  
  683.  Related Information: 
  684.  
  685.      Default OS/2 Exception Handling 
  686.      The Handling OS/2 Exceptions in the Programming Guide 
  687.  
  688.  
  689. ΓòÉΓòÉΓòÉ <hidden> VisualAge C++ default OS/2 exception handling ΓòÉΓòÉΓòÉ
  690.  
  691. The VisualAge C++ library provides its own default exception handling 
  692. functions: 
  693.  
  694.      _Lib_excpt, for OS/2 exceptions occurring in library functions, and 
  695.      _Exception, for all other OS/2 exceptions. 
  696.  
  697.  You can use these exception handlers or create and register your own. 
  698.  
  699.  
  700. ΓòÉΓòÉΓòÉ 7.2.3. Creating your own OS/2 exception handler ΓòÉΓòÉΓòÉ
  701.  
  702. You can use OS/2 APIs and the information provided in the bsexcpt.h header file 
  703. found in the \IBMCPP\INCLUDE\OS2 directory to create your own exception 
  704. handlers to use alone or with the two provided handler functions. Exception 
  705. handlers can be complex to write and difficult to debug, but creating your own 
  706. offers you two advantages: 
  707.  
  708.    1. You receive more information about the error condition. 
  709.    2. You can intercept any OS/2 exception. The VisualAge C++ library passes 
  710.       some exceptions back to the operating system because there is no C 
  711.       semantic for handling them. 
  712.  
  713.  Related Information: 
  714.  
  715.      The Creating your own OS/2 Exception Handler section of the Programming 
  716.       Guide 
  717.  
  718.  
  719. ΓòÉΓòÉΓòÉ 7.2.4. Handling C++ exceptions ΓòÉΓòÉΓòÉ
  720.  
  721. C++ provides three language constructs to implement exception handling: 
  722.  
  723.      try and catch blocks, syntax: 
  724.  
  725.              try { statement [statement] }
  726.              catch ( type-specifier [type-specifier] [declarator | abstract-declarator ]
  727.              { statement [statement] }
  728.  
  729.      throw expressions, syntax: 
  730.  
  731.              throw [assignment-expression]
  732.  
  733.  The steps required to implement an exception handler are: 
  734.  
  735.    1. Functions that are expected to be used by many programs are coded so 
  736.       that, when an error is detected, an exception is thrown. The throw 
  737.       expression generally throws an object. It may be created explicitly for 
  738.       purposes of exception handling, or it may be the object that caused the 
  739.       error to be detected. 
  740.  
  741.    2. Exceptions are anticipated in a caller by means of a try statement. 
  742.       Function calls that you anticipate might produce an exception must be 
  743.       enclosed in braces and preceded by the keyword try. 
  744.  
  745.    3. Immediately following the try block, you must code one or more catch 
  746.       blocks. Each catch block identifies what type or class of objects it can 
  747.       catch: 
  748.  
  749.         a. If the object thrown matches the type of a catch expression, control 
  750.            passes to that catch block. 
  751.         b. If the object thrown does not match the first catch block, 
  752.            subsequent catch blocks are searched for a matching type. 
  753.         c. If no match is found, the search continues in all enclosing try 
  754.            blocks and then in the code that called the current function. 
  755.         d. If no match is found after all try blocks are searched, a call to 
  756.            terminate() is made. 
  757.  
  758.  Notes on throwing exceptions: 
  759.  
  760.      Any object can be thrown if it can be copied and destroyed in the 
  761.       function from which the throw occurs. 
  762.      Exceptions should never be thrown from a C language signal handler. The 
  763.       result is undefined, and can cause program termination. 
  764.  
  765.  Related Information: 
  766.  
  767.      The C++ Exception Handling section of the Language Reference 
  768.  
  769.  
  770. ΓòÉΓòÉΓòÉ 7.2.5. Handling C/C++ signals ΓòÉΓòÉΓòÉ
  771.  
  772. Signals are C and C++ language constructs provided for error handling. A signal 
  773. is a condition reported as a result of an error in program execution. It may 
  774. also be caused by deliberate programmer action. With the VisualAge C++ product, 
  775. operating system exceptions are mapped to signals for you. The VisualAge C++ 
  776. product provides a number of different symbols to differentiate between error 
  777. conditions. The signal constants are defined in the signal.h header file. 
  778.  
  779. C provides two functions that deal with signal handling in the runtime 
  780. environment: raise and signal. Signals can be reported by an explicit call to 
  781. raise, but are generally reported as a result of: 
  782.  
  783.      A machine interrupt (for example, division by zero), 
  784.      A user action (for example, pressing Ctrl-C or Ctrl-Break), or 
  785.      An operating system exception. 
  786.  
  787.  Use the signal function to specify how to handle a particular signal. For each 
  788.  signal, you can specify one of 3 types of handlers: 
  789.  
  790.  SIG_DFL 
  791.       Use the VisualAge C++ default handling.  For most signals, the default 
  792.       action is to terminate the process with an error message. 
  793.  SIG_IGN 
  794.       Ignore the condition and continue running the program. Some signals 
  795.       cannot be ignored, such as division by zero. If you specify SIG_IGN for 
  796.       one of these signals, the VisualAge C++ library will treat the signal as 
  797.       if SIG_DFL was specified. 
  798.  Your own signal handler function 
  799.       Call the function you specify.  It can be any function, and can call any 
  800.       library function.  Note that when the signal is reported and your 
  801.       function is called, signal handling is reset to SIG_DFL to prevent 
  802.       recursion should the same signal be reported from your function. 
  803.  
  804.  The initial setting for all signals is SIG_DFL, the default action. 
  805.  
  806.  Related Information: 
  807.  
  808.      Default Handling of Signals 
  809.      The raise - Send Signal section of the C Library Reference 
  810.      The signal - Handle Interrupt Signals section of the C Library Reference 
  811.  
  812.  
  813. ΓòÉΓòÉΓòÉ <hidden> Default handling of signals ΓòÉΓòÉΓòÉ
  814.  
  815. The runtime environment will perform default handling of a given signal unless 
  816. a specific signal handler is established or the signal is disabled (set to 
  817. SIG_IGN). You can also set or reset default handling by coding: 
  818.  
  819.    signal(sig, SIG_DFL);
  820.  
  821. The default handling depends upon the signal that is being handled. For most 
  822. signals, the default is to pass the signal to the next exception handler in the 
  823. chain. 
  824.  
  825. Unless you have set up your own exception handler, the default OS/2 exception 
  826. handler receives the signal and performs the default action, which is to 
  827. terminate the program and return an exit code. The exit code indicates: 
  828.  
  829.    1. The reason for the program termination. 
  830.    2. The return code from DosExit. 
  831.  
  832.  When you use signal handlers, keep the following points in mind: 
  833.  
  834.      When you call the raise function in a multithread program, the handler 
  835.       for the signal you raise must be established on the thread where the call 
  836.       was made. 
  837.  
  838.      If your signal handler resides in a dynamic link library (DLL), ensure 
  839.       that you change the signal handler when you unload the DLL. If you unload 
  840.       your DLL without changing the signal handler, no warnings or error 
  841.       messages are generated. When your signal handler gets called, your 
  842.       program will probably terminate. If another DLL has been loaded in the 
  843.       same address range, your program may continue but with undefined results. 
  844.  
  845.      Variables referenced by both the signal handler and by other code should 
  846.       be given the attribute volatile. Declaring the variables as volatile 
  847.       indicates to the compiler that references to these variables may have 
  848.       side effects, so the compiler stores changes to the variables 
  849.       immediately. 
  850.  
  851.  
  852. ΓòÉΓòÉΓòÉ 7.2.6. Handling signals and OS/2 exceptions in DLLs ΓòÉΓòÉΓòÉ
  853.  
  854.  
  855. ΓòÉΓòÉΓòÉ 7.2.7. OS/2 exception handling considerations ΓòÉΓòÉΓòÉ
  856.  
  857. All the restrictions for signal handling apply to exception handling as well. 
  858. There are also a number of additional considerations you should keep in mind 
  859. when you use exception handling: 
  860.  
  861.      You must register an exception handler whenever you change library 
  862.       environments to ensure that exception handling is provided for all C 
  863.       code. 
  864.      Ensure that you always deregister your exception handler. 
  865.      If you register your own exception handler, the OS/2 exceptions you 
  866.       handle are not seen by a signal handler. The exceptions you do not handle 
  867.       are passed to the next exception handler. 
  868.      If you are using OS/2 semaphores and an exception occurs while your code 
  869.       owns a semaphore, you must ensure that the semaphore is released. 
  870.      Always check the exception flags to determine how the exception occurred. 
  871.      Keep your exception handler simple and specific. 
  872.      Check for and handle only the exceptions that you expect to encounter, 
  873.       and provide a default exception handler to handle unexpected exceptions. 
  874.      You need approximately 1.5K of stack remaining for the operating system 
  875.       to be able to call your exception handler. 
  876.      Neither of the VisualAge C++ default exception handlers are available in 
  877.       the subsystem libraries. 
  878.  
  879.  Related Information: 
  880.  
  881.      The Handling OS/2 Exceptions 
  882.  
  883.  
  884. ΓòÉΓòÉΓòÉ 7.2.8. Handling signals in a multithread program ΓòÉΓòÉΓòÉ
  885.  
  886. The default handling of signals is usually either to terminate the program or 
  887. to ignore the signal. However, special-purpose signal handling can be 
  888. complicated in the multithread environment. 
  889.  
  890. Signal handlers are registered independently on each thread. For example, if 
  891. thread 1 calls signal as follows: 
  892.  
  893.    signal (SIGFPE, handlerfunc);
  894.  
  895. then the handler handlerfunc is registered for thread 1 only. Any other threads 
  896. are handled using the defaults. 
  897.  
  898. A signal is always handled on the thread that generated it, except for 
  899. SIGBREAK, SIGINT, and SIGTERM. These three signals are handled on the thread 
  900. that generated them only if they were raised using the raise function. If they 
  901. were raised by an exception, they will be handled on thread 1. 
  902.  
  903. Related Tasks: 
  904.  
  905.      How do I create a multithread program 
  906.      How do I compile and link a multithread program 
  907.  
  908.  Related Information: 
  909.  
  910.      The Signal Handling in Multithread Programs section of the Programming 
  911.       Guide 
  912.  
  913.  
  914. ΓòÉΓòÉΓòÉ 7.3. Demangling (decoding) a C++ function name ΓòÉΓòÉΓòÉ
  915.  
  916. When the VisualAge C++ compiler compiles a C++ program, it encodes all C++ 
  917. symbolic names to include type and scoping information. This is called 
  918. mangling. The linker uses the mangled names in the object files to resolve 
  919. external references using the exported names. Exported names are functions and 
  920. certain other identifiers that are made available to programs that call the 
  921. dynamic link library (DLL) in which the names are defined. Tools that use the 
  922. files with mangled names do not have access to the original source, and 
  923. therefore present the mangled names. 
  924.  
  925. Use the CPPFILT utility to convert mangled names to demangled names in two 
  926. separate modes: text and binary. All output is sent to stdout. 
  927.  
  928. To demangle a text file: 
  929.  
  930.    cppfilt text_file_name
  931.  
  932. To demangle a binary .OBJ and .LIB file: 
  933.  
  934.    cppfilt /B obj_file_name lib_file_name
  935.  
  936. Note:  You can use options on the CPPFILT utility. Use the /? for a list of 
  937.        possible options available. 
  938.  
  939.  Related Information: 
  940.  
  941.      The Demangling Compiled C++ Names with CPPFILT section of the User's 
  942.       Guide 
  943.  
  944.  
  945. ΓòÉΓòÉΓòÉ 7.4. Changing locale without recompiling my code ΓòÉΓòÉΓòÉ
  946.  
  947. You can use environment variables to specify the names of locale categories. 
  948. You must call setlocale regardless of environmental variable settings. However, 
  949. if you do not explicitly specify the name, the locale is changed according to 
  950. the environment variables. 
  951.  
  952. For example, the following causes the environment variable LC_ALL to be 
  953. initialized to the value TEXAN:    _putenv("LC_ALL=TEXAN"); 
  954.  
  955. To change a locale from within your code: 
  956.  
  957.    1. Be sure to include the locale header file: 
  958.          #include <locale.h> 
  959.    2. Use the following lines to set the locale: 
  960.          setlocale(LC_ALL, ""); 
  961.          _putenv("LC_ALL=TEXAN"); 
  962.  
  963.  The names of the environment variables match the names of the locale 
  964.  categories: 
  965.  
  966.  LC_ALL 
  967.  
  968.  LC_COLLATE 
  969.       Defines the relative order between collating elements (characters and 
  970.       multicharacter collating elements) in the locale. 
  971.  LC_CTYPE 
  972.       Defines character classification, case convention, and other character 
  973.       attributes. 
  974.  LC_MESSAGES 
  975.       Defines the format and values for positive and negative responses. 
  976.  LC_MONETARY 
  977.       Defines the rules and symbols used to format monetary quantities. 
  978.  LC_NUMERIC 
  979.       Defines the rules and symbols used to format non-monetary numeric 
  980.       information. 
  981.  LC_TIME 
  982.       Defines the interpretation of the field description used for passing, 
  983.       then formatting, the data. 
  984.  LC_TOD 
  985.       Defines the rules to define the beginning, end, and duration of daylight 
  986.       savings time, and the difference between local time and Greenwich Mean 
  987.       Time. 
  988.  LC_SYNTAX 
  989.       Defines the variant characters from the portable character set. 
  990.  
  991.  Related Information: 
  992.  
  993.      The Introduction to Locale section of the Programming Guide 
  994.      The Locale Categories section of the Programming Guide 
  995.  
  996.  
  997. ΓòÉΓòÉΓòÉ 7.5. Redirecting standard input/output streams ΓòÉΓòÉΓòÉ
  998.  
  999. There may be times when you want to redirect a standard stream to a file. There 
  1000. are two ways to do this: 
  1001.  
  1002.      From within a program 
  1003.      From the command line 
  1004.  
  1005.  
  1006. ΓòÉΓòÉΓòÉ 7.5.1. Redirection from within a program ΓòÉΓòÉΓòÉ
  1007.  
  1008. To redirect C standard streams to a file from within your program, use the 
  1009. freopen library function. For example, to redirect your output to a file called 
  1010. pia.out instead of stdout, code the following statement in your program: 
  1011.  
  1012.    freopen("pia.out", "w", stdout);
  1013.  
  1014. You can reassign a C++ standard stream to another istream (cin only) or ostream 
  1015. object, or to a streambuf object, using the operator=. For example, to redirect 
  1016. your output to a file called sample.out, create sample.out as an ostream 
  1017. object, and assign cout to it: 
  1018.  
  1019.    #include <fstream.h>
  1020.  
  1021.    int main(void)
  1022.    {
  1023.       cout << "This is going to the standard output stream" << endl;
  1024.  
  1025.       ofstream outfile("sample.out");
  1026.       cout = outfile;
  1027.       cout << "This is going to sample.out file" << endl;
  1028.  
  1029.       return 0;
  1030.    }
  1031.  
  1032. You could also assign cout to outfile.rdbuf() to perform the same redirection. 
  1033.  
  1034. Related Information: 
  1035.  
  1036.      The Associating a File with a Standard Input or Output Stream section of 
  1037.       the Open Class Library User's Guide 
  1038.  
  1039.  
  1040. ΓòÉΓòÉΓòÉ 7.5.2. Redirection from the command line ΓòÉΓòÉΓòÉ
  1041.  
  1042. To redirect a C or C++ standard stream to a file from the command line, use the 
  1043. standard OS/2 redirection symbols. 
  1044.  
  1045. For example, to run the program sample.exe, which has two required parameters 
  1046. XYZ and 123, and redirect the output from stdout to a file called sample.out, 
  1047. you would use the following command: 
  1048.  
  1049.    bill XYZ 123 > bill.out
  1050.  
  1051. You can also use the OS/2 file handles to redirect one standard stream to 
  1052. another. For example, to redirect stderr to stdout, you would use the 2> 
  1053. redirection symbol: 
  1054.  
  1055.    bill XYZ 123 2> bill.err
  1056.  
  1057. Note:  You cannot use redirection from the command line for memory files. 
  1058.  
  1059.  Related Information: 
  1060.  
  1061.      Refer to the OS/2 online Master Help Index for more information on 
  1062.       redirection symbols. 
  1063.  
  1064.  
  1065. ΓòÉΓòÉΓòÉ 7.6. Mixing old and new templates ΓòÉΓòÉΓòÉ
  1066.  
  1067. The way that VisualAge C++ resolves template functions and data is new for this 
  1068. release. Suppose that you are linking a new application, and you want to link 
  1069. object files or static libraries that: 
  1070.  
  1071.      Were created using a previous release of VisualAge C++. 
  1072.      Contain templates. 
  1073.  
  1074.  To perform such a link, you must compile with the /Gk+ option. When you 
  1075.  specify this option, ICC uses the template resolution method from previous 
  1076.  releases. In addition, this option causes the compiler to supply the /OLDCPP 
  1077.  option to the linker. If you do not specify the /Gk+ option, the linker 
  1078.  produces an error message asking you to link using /OLDCPP. If you get this 
  1079.  error message, you should recompile using the /Gk+ option. 
  1080.  
  1081.  Related Information: 
  1082.  
  1083.      The Using Templates section of the Programming Guide 
  1084.  
  1085.  
  1086. ΓòÉΓòÉΓòÉ 7.7. Creating a multithread program ΓòÉΓòÉΓòÉ
  1087.  
  1088. A multithread program is one whose functions are divided among several threads. 
  1089. A process is an executing application and the resources it uses, a thread is 
  1090. the smallest unit of execution within a process. Other than its stack and 
  1091. registers, a thread owns no resources; it uses those of its parent process. 
  1092.  
  1093. Multithread programming is a feature of the OS/2 operating system and is 
  1094. supported by the VisualAge C++ compiler with: 
  1095.  
  1096.  Multithread libraries 
  1097.       The VisualAge C++ compiler has two standard libraries that provide 
  1098.       library functions for use in multithread programs. The CPPOM30.LIB 
  1099.       library is a statically linked multithread library, and CPPOM30I.LIB is 
  1100.       an import multithread library, with the addresses of the functions 
  1101.       contained in the VisualAge C++ DLLs. In addition, the follow classes of 
  1102.       the VisualAge C++ Open Class Library are available in multithread form: 
  1103.  
  1104.           The User Interface classes, 
  1105.           The Complex Mathematics classes, and 
  1106.           The I/O Stream classes. 
  1107.  
  1108.       Note that when you use the multithread libraries, you have more to 
  1109.       consider than with the single-thread libraries. For example, access to 
  1110.       resources must be limited to one thread at a time to prevent functions 
  1111.       from interfering with each other, other functions can affect all threads 
  1112.       running within a process, and global variables and error handling are 
  1113.       also affected by the multithread environment. 
  1114.  
  1115.  Code generation and linking options 
  1116.       When you compile your multithread program, you must specify that you want 
  1117.       to use the multithread libraries. Because threads share data, the 
  1118.       operating system and library functions must ensure that only one thread 
  1119.       is reading or writing data at a time. The multithread libraries provide 
  1120.       this support. To indicate that you want the multithread libraries, 
  1121.       specify the /Gm+ compiler option. You must compile all modules with this 
  1122.       option. You cannot mix multithread with singlethread. You can use either 
  1123.       static (/Gd-) or dynamic (/Gd+) linking with multithread programs. 
  1124.  
  1125.  Related Tasks: 
  1126.  
  1127.      How do I compile and link a multithread program 
  1128.      How do I handle signals in a multithread program 
  1129.  
  1130.  Related Information: 
  1131.  
  1132.      The Creating Multithread Programs section of the Programming Guide 
  1133.  
  1134.  
  1135. ΓòÉΓòÉΓòÉ 8. Combine C and C++ ΓòÉΓòÉΓòÉ
  1136.  
  1137. The following are some topics on combining the C and C++ language conventions. 
  1138. Note that this is not an exhaustive list: 
  1139.  
  1140.      Calling a C++ function from a C program 
  1141.      Using C Objects in C++ programs 
  1142.      Creating header files to work with both C and C++ 
  1143.      Handling C/C++ signals 
  1144.      Migrating headers from 16-bit to 32-bit C or C++ 
  1145.  
  1146.  For more information on combining C and C++, see: 
  1147.  
  1148.      The  Coding Your Program section of the Programming Guide, or 
  1149.      The Language Reference 
  1150.  
  1151.  
  1152. ΓòÉΓòÉΓòÉ 8.1. Calling a C++ function from a C program ΓòÉΓòÉΓòÉ
  1153.  
  1154. To call a C++ routine defined in a .CPP file from a C file: 
  1155.  
  1156.    1. Define the C++ function as extern "C" in your C++ code. 
  1157.    2. Call the function from the C code. 
  1158.  
  1159.  
  1160. ΓòÉΓòÉΓòÉ 8.2. Using C objects in C++ programs ΓòÉΓòÉΓòÉ
  1161.  
  1162. To link your C++ code with C objects: 
  1163.  
  1164.      You must inform the C++ compiler that an external name uses C naming 
  1165.       conventions, by using the extern "C" when you declare the function. 
  1166.  
  1167.  If you do not use this convention, the C++ compiler mangles the name. 
  1168.  
  1169.  Note:  Using the keywords for calling conventions, such as _System and 
  1170.         _Optlink, in your function definition is equivalent to defining the 
  1171.         function as extern "C". 
  1172.  
  1173.  
  1174. ΓòÉΓòÉΓòÉ 8.3. Creating header files to work with both C and C++ ΓòÉΓòÉΓòÉ
  1175.  
  1176.  
  1177. ΓòÉΓòÉΓòÉ 8.4. Handling C/C++ signals ΓòÉΓòÉΓòÉ
  1178.  
  1179.  
  1180. ΓòÉΓòÉΓòÉ 8.5. Migrating headers from 16-bit to 32-bit C or C++ ΓòÉΓòÉΓòÉ
  1181.  
  1182.  
  1183. ΓòÉΓòÉΓòÉ 9. Compile and Link a Multithread Program ΓòÉΓòÉΓòÉ
  1184.  
  1185. When you compile a multithread program, you must specify that you want to use 
  1186. the multithread libraries. Because threads share data, the operating system and 
  1187. library functions must ensure that only one thread is reading or writing data 
  1188. at one time. The multithread libraries shipped with VisualAge C++ provide this 
  1189. support. 
  1190.  
  1191. To indicate that you want the multithread libraries, specify the /Gm+ compiler 
  1192. option. Conversely, the /Gm- option, which is the default, specifies the use of 
  1193. the single-thread version of the library. 
  1194.  
  1195. If you intend to compile your source code into separate modules and then link 
  1196. them into one executable program file, you must compile each module using the 
  1197. /Gm+ option and ensure that the multithread libraries are used when you link 
  1198. them. You cannot mix modules that have been compiled with /Gm+ with modules 
  1199. compiled using /Gm-. 
  1200.  
  1201. You can use either static (/Gd-) or dynamic (/Gd+) linking with multithread 
  1202. programs. 
  1203.  
  1204. Related Tasks: 
  1205.  
  1206.      How do I create a multithread program 
  1207.      How do I handle signals in a multithread program 
  1208.  
  1209.  Related Information: 
  1210.  
  1211.      The Creating Multithread Programs section of the Programming Guide 
  1212.  
  1213.  
  1214. ΓòÉΓòÉΓòÉ 10. Compile my Programs ΓòÉΓòÉΓòÉ
  1215.  
  1216. You can compile your programs in three ways. Note that this is not an 
  1217. exhaustive list: 
  1218.  
  1219.      From within WorkFrame 
  1220.      From the command line 
  1221.      Using a make file 
  1222.  
  1223.  The output created from compiling the source can be: 
  1224.  
  1225.      An .EXE file 
  1226.      An .OBJ file 
  1227.      A PM program 
  1228.      SOM Code 
  1229.  
  1230.  You can also compile your source to generate information for: 
  1231.  
  1232.      Debugging 
  1233.      Browsing 
  1234.      Analysis 
  1235.  
  1236.  You can use the compiler options to: 
  1237.  
  1238.      Control messages 
  1239.      Control #include Search Paths 
  1240.      Create a compiler listing 
  1241.      Optimize for speed and size 
  1242.      Set the source code language level 
  1243.      Set the calling convention 
  1244.      Set the stack size 
  1245.  
  1246.  Related Tasks: 
  1247.  
  1248.      How do I compile and link a multithread program 
  1249.      How do I set compiler options using WorkFrame 
  1250.  
  1251.  Related Information: 
  1252.  
  1253.      The Compiling section of the User's Guide 
  1254.  
  1255.  
  1256. ΓòÉΓòÉΓòÉ 10.1. Compiling from within WorkFrame ΓòÉΓòÉΓòÉ
  1257.  
  1258. To compile the target of a WorkFrame project: 
  1259.  
  1260.      From the project icon: 
  1261.         1. Click Mouse Button 2 on the WorkFrame project icon. 
  1262.         2. Select the Build menu item. 
  1263.      Or, from within the project environment: 
  1264.         1. Select the Project PullDown menu. 
  1265.         2. Select the Build menu item. 
  1266.  
  1267.  WorkFrame will build the project's target based on the compiler options set. 
  1268.  
  1269.  To compile individual files or groups of files from within the WorkFrame 
  1270.  project environment: 
  1271.  
  1272.    1. Double-click on the WorkFrame project icon to open the project 
  1273.       environment. 
  1274.    2. Select the source files that you want to compile. 
  1275.    3. Click Mouse Button 2 on the background, or select the Selected PullDown 
  1276.       menu. 
  1277.    4. Select the Compile menu item. 
  1278.  
  1279.  Related Tasks: 
  1280.  
  1281.      How do I develop using WorkFrame 
  1282.      How do I set compiler options using WorkFrame 
  1283.      How do I set linker options using WorkFrame 
  1284.      How do I compile from the command line 
  1285.  
  1286.  Related Information: 
  1287.  
  1288.      The WorkFrame How Do I information 
  1289.      The WorkFrame section of the User's Guide 
  1290.  
  1291.  
  1292. ΓòÉΓòÉΓòÉ 10.2. Compiling from the command line ΓòÉΓòÉΓòÉ
  1293.  
  1294. Depending on how you want to compile your files and how you have set up the ICC 
  1295. environment variable, many of the parameters used with the icc command are 
  1296. optional when you issue the command from a command line. 
  1297.  
  1298. The syntax for the icc command is as follows: 
  1299.  
  1300. icc [@response_file]
  1301.  
  1302. or 
  1303.  
  1304. icc [/options source_file | intermediate_file | object | library | def_file ]
  1305.  
  1306. For example, to compile and link the program bob.c, you would enter the 
  1307. following: 
  1308.  
  1309.     icc bob.c
  1310.  
  1311. An object code file bob.obj, and an executable file bob.exe are created. 
  1312.  
  1313. Related Tasks: 
  1314.  
  1315.      How do I set compiler options using WorkFrame 
  1316.      How do I set linker options using WorkFrame 
  1317.      How do I compile from within WorkFrame 
  1318.  
  1319.  Related Information: 
  1320.  
  1321.      The Compiler Options section of the User's Guide 
  1322.  
  1323.  
  1324. ΓòÉΓòÉΓòÉ <hidden> Compiling using response files ΓòÉΓòÉΓòÉ
  1325.  
  1326. Instead of specifying compiler options and source files on the command line, 
  1327. you can use a response file. A response file is a text file that contains a 
  1328. string of options and file names to be passed to icc. (The string does not 
  1329. specify icc itself.) For example, the response file that contains the 
  1330. following: 
  1331.  
  1332.     /Sa /Fl sample.c
  1333.  
  1334. would give the following command line: 
  1335.  
  1336.     icc /Sa /Fl sample.c
  1337.  
  1338. A response file can have any valid file name and extension. To use the response 
  1339. file, specify it on the icc command line preceded by the at sign (@). For 
  1340. example: 
  1341.  
  1342.     icc @d:\response.fil
  1343.  
  1344. No space can appear between the @ and the file name. You can use multiple 
  1345. response files, and even call another response file from within a response 
  1346. file. You can mix response files with other input on the command line. Options 
  1347. and file names set in the ICC environment variable are still used. 
  1348.  
  1349. The command string in a response file can span multiple lines. No continuation 
  1350. character is required. The string can also be longer than the limit imposed by 
  1351. the OS/2 command line. In some situations you may need to use a response file 
  1352. to accommodate a long command line, such as when you use the intermediate code 
  1353. linker or compile C++ code containing templates. 
  1354.  
  1355.  
  1356. ΓòÉΓòÉΓòÉ 10.3. Compiling using a make file ΓòÉΓòÉΓòÉ
  1357.  
  1358. Use a make file to organize the sequence of actions (such as compiling and 
  1359. linking) required to build your project. You can then invoke all the actions in 
  1360. one step. The NMAKE utility can save you time by performing actions on only the 
  1361. files that have changed, and on the files that incorporate or depend on the 
  1362. changed files. 
  1363.  
  1364. You can write the make file yourself, or you can use the WorkFrame tool 
  1365. MakeMake to write it for you. 
  1366.  
  1367. Related Tasks: 
  1368.  
  1369.      How do I create make files and dependency files 
  1370.  
  1371.  
  1372. ΓòÉΓòÉΓòÉ 10.4. Compiling to an .EXE file ΓòÉΓòÉΓòÉ
  1373.  
  1374. By default, the compiler generates one executable file for each compiler 
  1375. invocation. If you specify /C+, the compiler generates only object files, which 
  1376. you can then link separately to create an executable file. 
  1377.  
  1378. You can use several compiler options to change the executable file created by 
  1379. the compiler into a: 
  1380.  
  1381.      Dynamically linked runtime library 
  1382.      Statically linked runtime library 
  1383.      Single-thread program 
  1384.      Multithread program 
  1385.      Subsystem 
  1386.  
  1387.  See the Code Generation Options section of the User's Guide for more 
  1388.  information on changing an .EXE file. 
  1389.  
  1390.  Related Tasks: 
  1391.  
  1392.      How do I set compiler options using WorkFrame 
  1393.      How do I set linker options using WorkFrame 
  1394.      How do I compile from the command line 
  1395.      How do I compile from within WorkFrame 
  1396.  
  1397.  
  1398. ΓòÉΓòÉΓòÉ 10.5. Compiling to an .OBJ file ΓòÉΓòÉΓòÉ
  1399.  
  1400. To create object (.OBJ) files, which you can link separately to create an .EXE 
  1401. file: 
  1402.  
  1403.      Compile with the /C+ option. 
  1404.  
  1405.  Related Tasks: 
  1406.  
  1407.      How do I create an .EXE file 
  1408.      How do I set compiler options using WorkFrame 
  1409.      How do I set linker options using WorkFrame 
  1410.      How do I compile from the command line 
  1411.      How do I compile from within WorkFrame 
  1412.  
  1413.  Related Information: 
  1414.  
  1415.      The Code Generation Options section of the User's Guide 
  1416.  
  1417.  
  1418. ΓòÉΓòÉΓòÉ 10.6. Compiling to a PM program ΓòÉΓòÉΓòÉ
  1419.  
  1420. If you are using the VisualAge C++ product to develop PM applications, you may 
  1421. need the following options: 
  1422.  
  1423.  Option   Description 
  1424.  /Se      Allow all VisualAge C++ language extensions. (This is the default.) 
  1425.  /Gm      Use the multithread libraries. 
  1426.  /Gs-     Do not remove stack probes.  (This is the default.) 
  1427.  /Wpro    Produce diagnostic messages about unprototyped functions. (These are 
  1428.           generated by default). 
  1429.  
  1430.  Related Tasks: 
  1431.  
  1432.      How do I set compiler options using WorkFrame 
  1433.      How do I set linker options using WorkFrame 
  1434.      How do I compile from the command line 
  1435.      How do I compile from within WorkFrame 
  1436.  
  1437.  
  1438. ΓòÉΓòÉΓòÉ 10.7. Compiling to SOM code ΓòÉΓòÉΓòÉ
  1439.  
  1440. To compile your source for SOM choose from the following options: 
  1441.  
  1442.  /Fr<classname> Use this option to have the compiler write the release order of 
  1443.       the specified class to standard output. The release order is written in 
  1444.       the form of a SOMReleaseOrder pragma. You can capture the output from 
  1445.       this option when developing new SOM classes, and include the pragma in 
  1446.       the class definition. 
  1447.  /Fs[+|-|filename|directory] Use this option to have the compiler generate an 
  1448.       IDL file when a file with an .h extension is explicitly specified on the 
  1449.       command line. 
  1450.  /Ga[+|-] Turns on implicit SOM mode, and also causes the file som.hh to be 
  1451.       included. It is equivalent to placing #pragma SOMAsDefault(on) at the 
  1452.       start of the translation unit. 
  1453.  /Gb[+|-] Instructs the compiler to disable direct access to attributes. 
  1454.       Instead, the get and set methods are used. It is equivalent to placing 
  1455.       #pragma SOMNoDataDirect(on) as the first line of the translation unit. 
  1456.  /Gz[+|-] Causes the initialization of the SOM classes to be done during static 
  1457.       initialization time. If this option is set on, code is generated to check 
  1458.       if the class has already been initialized. With either setting of this 
  1459.       option, any reference to a static member of a SOM class will cause the 
  1460.       class to be initialized. The default setting for this option is off. 
  1461.  /Xs<directory> Excludes files in the specified directories when implicit SOM 
  1462.       mode is turned on (when classes are implicitly derived from SOM). 
  1463.  
  1464.  Note:  SOM options that affect the same settings as SOM pragmas are effective 
  1465.         except when overriden by those pragmas. 
  1466.  
  1467.  Related Tasks: 
  1468.  
  1469.      How do I set compiler options using WorkFrame 
  1470.      How do I set linker options using WorkFrame 
  1471.      How do I compile from the command line 
  1472.      How do I compile from within WorkFrame 
  1473.  
  1474.  Related Information: 
  1475.  
  1476.      The IBM System Object Model section of the Programming Guide 
  1477.  
  1478.  
  1479. ΓòÉΓòÉΓòÉ 10.8. Compiling for debugging ΓòÉΓòÉΓòÉ
  1480.  
  1481. The information necessary for running the VisualAge C++ Debugger can be placed 
  1482. in the object file produced by the compiler using the /Ti+ option. If you use 
  1483. icc to automatically invoke the linker and specify the /Ti+ compiler option, 
  1484. the /DE linker option is automatically passed to the linker. The /DE linker 
  1485. option includes the Debugger information in the executable or DLL file. 
  1486.  
  1487. When you use /Ti+, do not turn on optimization (/O+, /Oc+, /Oi+, or /Os+), 
  1488. unless you are using the information with Performance Analyzer, and not with 
  1489. the Debugger. Because the compiler produces debugging information as if the 
  1490. code were not optimized, the information may not accurately describe an 
  1491. optimized program being debugged, which makes debugging difficult. Accurate 
  1492. symbol and type information is not always available. 
  1493.  
  1494. Because of the effects of optimization, debugging information generated with 
  1495. optimization is limited to setting breakpoints at function entry and function 
  1496. exit and stepping through the program at assembly level. Accurate symbol and 
  1497. type information is not always available. 
  1498.  
  1499. If you cannot avoid debugging an optimized program, turn the scheduler off 
  1500. (/Os-), and step through the program at the assembly level, using the Register 
  1501. and Storage windows for information. 
  1502.  
  1503. To make full use of the VisualAge C++ Debugger, set optimization off and use 
  1504. the /G3 option. Note that these are the defaults. 
  1505.  
  1506. Related Tasks: 
  1507.  
  1508.      How do I debug my programs 
  1509.      How do I set compiler options using WorkFrame 
  1510.      How do I set linker options using WorkFrame 
  1511.      How do I compile from the command line 
  1512.      How do I compile from within WorkFrame 
  1513.  
  1514.  Related Information: 
  1515.  
  1516.      The Debugging section of the User's Guide 
  1517.      The Debugger How Do I... information 
  1518.  
  1519.  
  1520. ΓòÉΓòÉΓòÉ 10.9. Compiling for browsing ΓòÉΓòÉΓòÉ
  1521.  
  1522. Use /Fb to produce a browser (.PDB) file. Only compile with /Fb* if the 
  1523. compiler issues a message telling you that you should use it. 
  1524.  
  1525. Note:  These options are valid for C++ files only. By default, the compiler 
  1526.        does not produce a Browser file. 
  1527.  
  1528.  The difference between the two options related to how much Browser information 
  1529.  is generated from system include files. That is, those included via: 
  1530.  
  1531.     #include <system_file.h> as opposed to: 
  1532.     #include "local_file.h. 
  1533.  
  1534.  The /Fb option discards much of the non-type information from inside of system 
  1535.  include files. For instance: 
  1536.  
  1537.      Non-member function declarations will not be included in the .PDB file, 
  1538.       including those C and OS/2 header files. Any friendship granted to these 
  1539.       types of omitted functions will not be recorded for a class. For 
  1540.       instance: 
  1541.  
  1542.                // in <foo.h>
  1543.                   int foobar(void);
  1544.                // in "bar.h"
  1545.                   class bar {
  1546.                     friend int foobar(void);
  1547.                   }
  1548.  
  1549.       This friendship will not be included in the list of friends of class bar. 
  1550.  
  1551.      No global variable declared, or defined, in the system header file will 
  1552.       be included in the .PDB file. This includes variables of an instanstiated 
  1553.       template type. 
  1554.  
  1555.      Class member function declarations will be added to the .PDB file, but 
  1556.       their inline definitions, if any, will not. 
  1557.  
  1558.      Non-inline function definitions will not be added to the .PDB file. 
  1559.  
  1560.  These restrictions are lifted when compiling with the /Fb* option. You should 
  1561.  use the /Fb option, unless the compiler issues a message indicating that the 
  1562.  use of the /Fb* option is appropriate. 
  1563.  
  1564.  Related Tasks: 
  1565.  
  1566.      How do I browse my files 
  1567.      How do I set compiler options using WorkFrame 
  1568.      How do I set linker options using WorkFrame 
  1569.      How do I compile from the command line 
  1570.      How do I compile from within WorkFrame 
  1571.  
  1572.  Related Information: 
  1573.  
  1574.      The Browser section of the User's Guide 
  1575.      The Browser How Do I... information 
  1576.  
  1577.  
  1578. ΓòÉΓòÉΓòÉ 10.10. Compiling for analysis ΓòÉΓòÉΓòÉ
  1579.  
  1580. To include the information required by the Performance Analyzer in the object 
  1581. file, use both the /Ti+ and /Gh+ options. To include the Performance Analyzer 
  1582. information in the executable file or DLL, use the /DE linker option. If you 
  1583. use icc to invoke the linker and specify /Ti+, the /DE option is automatically 
  1584. passed to the linker. 
  1585.  
  1586. When you specify /Gh+, the compiler generates a call to a profiling hook 
  1587. function as the first instruction in the prolog of each function. There are two 
  1588. profiling hook functions: 
  1589.  
  1590.  _ProfileHook32 Profile hook for all 32-bit functions. 
  1591.  _ProfileHook16 Profile hook for all 16-bit callback functions. These functions 
  1592.            are defined with either the _Far16 _Cdecl or _Far16 _Pascal linkage 
  1593.            keywords. 
  1594.  
  1595.  Related Tasks: 
  1596.  
  1597.      How do I analyze performance 
  1598.      How do I set compiler options using WorkFrame 
  1599.      How do I set linker options using WorkFrame 
  1600.      How do I compile from the command line 
  1601.      How do I compile from within WorkFrame 
  1602.  
  1603.  Related Information: 
  1604.  
  1605.      The Analyzing Performance section of the User's Guide 
  1606.      The Performance Analyzer How Do I... information 
  1607.  
  1608.  
  1609. ΓòÉΓòÉΓòÉ 10.11. Controlling messages ΓòÉΓòÉΓòÉ
  1610.  
  1611. You can use compiler options to control: 
  1612.  
  1613.      The level of error message that the compiler outputs and that increments 
  1614.       the error count maintained by the compiler (with the /Wn option). 
  1615.      How many errors are allowed before the compiler stops compiling (with the 
  1616.       /Nn option). 
  1617.      The diagnostics run against the code, and the types of messages produced 
  1618.       (with the /Wgrp option). 
  1619.  
  1620.  Related Tasks: 
  1621.  
  1622.      How do I set compiler options using WorkFrame 
  1623.      How do I set linker options using WorkFrame 
  1624.      How do I compile from the command line 
  1625.      How do I compile from within WorkFrame 
  1626.  
  1627.  
  1628. ΓòÉΓòÉΓòÉ 10.12. Controlling #include search paths ΓòÉΓòÉΓòÉ
  1629.  
  1630. You can control the paths searched by the compiler when it looks for #include 
  1631. files. The paths that are searched are the result of the information in the 
  1632. INCLUDE and ICC environment variables, combined with how you use the following 
  1633. compiler options: 
  1634.  
  1635.  /Ipath[;path] Specifies the #include search path. Note that for user include 
  1636.       files, the directory of the source file is always searched first. 
  1637.  /Xc[+|-] Stops the compiler from searching paths specified using /I. 
  1638.  /Xi[+|-] Stop the compiler from searching paths specified by the INCLUDE 
  1639.       environment variable. 
  1640.  
  1641.  Related Tasks: 
  1642.  
  1643.      How do I set compiler options using WorkFrame 
  1644.      How do I set linker options using WorkFrame 
  1645.      How do I compile from the command line 
  1646.      How do I compile from within WorkFrame 
  1647.  
  1648.  
  1649. ΓòÉΓòÉΓòÉ 10.13. Creating a compiler listing ΓòÉΓòÉΓòÉ
  1650.  
  1651. At the very minimum, the listing will show the options used by the compiler, 
  1652. any error messages, and a standard header that shows: 
  1653.  
  1654.      The product number 
  1655.      The compiler version and release number 
  1656.      The date and time that the compilation began 
  1657.      A list of the compiler options in effect. 
  1658.  
  1659.  Use one or more of the following options to control whether or not a listing 
  1660.  file is produced, the type of information in the listing, and the appearance 
  1661.  of the file: 
  1662.  
  1663.  Option      Description 
  1664.  /Ls[+]      Includes your source program in the listing file. 
  1665.  /Li[+]      Shows the included text after the user #include directives. 
  1666.  /Lj[+]      Shows the included text after both user and system #include 
  1667.              directives. 
  1668.  /La[+]      Includes a table of all the referenced structure and union 
  1669.              variables in the source program. 
  1670.  /Lb[+]      Includes a table of all structure and union variables in the 
  1671.              program. 
  1672.  /Le[+]      Includes all expanded macros in the listing file. 
  1673.  /Lx[+]      Includes a cross-reference table that contains a list of the 
  1674.              referenced identifiers in the source file together with the 
  1675.              numbers of the lines in which they appear. 
  1676.  /Ly[+]      Includes a cross-reference table that contains a list of all 
  1677.              identifiers referenced by the user and all external identifiers, 
  1678.              together with the numbers of the lines in which they appear. 
  1679.  
  1680.  Notes for using some of the above options: 
  1681.  
  1682.      The above options only modify the appearance of a listing; they do not 
  1683.       cause a listing to be produced. Use them with one of the other listing 
  1684.       file options, or the /Fl option, to produce a listing: /Le, /Li, /Lj, 
  1685.       /Lp, /Lt, or /Lu. 
  1686.      If you specify any of the /Le, /Li, or /Lj options, you must also specify 
  1687.       the /L, /Lf, or /Ls option. 
  1688.      If you specify the /Lj option, /Li[+] and /Li-  have no effect. 
  1689.  
  1690.  Related Tasks: 
  1691.  
  1692.      How do I set compiler options using WorkFrame 
  1693.      How do I set linker options using WorkFrame 
  1694.      How do I compile from the command line 
  1695.      How do I compile from within WorkFrame 
  1696.  
  1697.  
  1698. ΓòÉΓòÉΓòÉ 10.14. Optimizing for speed and size ΓòÉΓòÉΓòÉ
  1699.  
  1700. The VisualAge C++ compiler can perform many optimizations, such as local and 
  1701. global optimizations, function inlining, and instruction scheduling on object 
  1702. code. Use the /O+ option to generate code that executes as fast as possible. By 
  1703. default, optimization is turned off (/O-). When you specify /O, you can also 
  1704. specify: 
  1705.  
  1706.  /Oc   Optimize code for size as well as speed. 
  1707.  /Op   Perform optimizations that involve the stack pointer. Turned on by 
  1708.        default when you specify /O. 
  1709.  /Os   Invoke the instruction scheduler. Turned on by default when you specify 
  1710.        /O. 
  1711.  
  1712.  By default, /O also sets /Oi to inline user functions qualified with the 
  1713.  _Inline or inline keywords. 
  1714.  
  1715.  The compiler can perform more complete optimization when you specify /Ol to 
  1716.  invoke the intermediate code linker. 
  1717.  
  1718.  Related Tasks: 
  1719.  
  1720.      How do I set compiler options using WorkFrame 
  1721.      How do I set linker options using WorkFrame 
  1722.      How do I compile from the command line 
  1723.      How do I compile from within WorkFrame 
  1724.  
  1725.  
  1726. ΓòÉΓòÉΓòÉ 10.15. Setting the source code language level ΓòÉΓòÉΓòÉ
  1727.  
  1728. You can set the language level of your source code to one of the following 
  1729. levels: 
  1730.  
  1731.  ANSI - Compile according to a strict interpretation of the ANSI standard. Use 
  1732.       this level when you want your code to be portable to other compilers. 
  1733.       Compile with /Sa or use the #pragma langlvl(ansi) directive. 
  1734.  SAA Level 2 - Compile according to the SAA Level 2 standard. Use this level 
  1735.       when you want your code to be portable to other IBM compilers. Compile 
  1736.       with /S2 or use the #pragma langlvl(saal2) directive. 
  1737.  Extended - Allow extended language features, allow non-standard language 
  1738.       usage. Use this level when you are compiling code ported from another 
  1739.       compiler, or when you are compiling code that does not need to be 
  1740.       portable. Compile with /Se or use the #pragma langlvl(extended) 
  1741.       directive. 
  1742.  Compatible - Allow older versions of the C++ language. Use this level when you 
  1743.       are compiling older code. Compile with /Sc or use the #pragma 
  1744.       langlvl(compat) directive. 
  1745.  
  1746.  Note that a #pragma langlvl directive in your source code overrides any 
  1747.  conflicting compiler options. When you set the language level, you also define 
  1748.  the macro associated with that level. The SAA C standards conform to the ANSI 
  1749.  standards, but also feature some additional elements. 
  1750.  
  1751.  Note:  If you will be compiling and running your code primarily on the 
  1752.         personal computer platform, you should use the extended language level. 
  1753.  
  1754.  Related Information: 
  1755.  
  1756.      The #pragma langlvl section of the Language Reference 
  1757.  
  1758.  
  1759. ΓòÉΓòÉΓòÉ 10.16. Setting the calling convention ΓòÉΓòÉΓòÉ
  1760.  
  1761. The VisualAge C++ compiler supports six 32-bit calling conventions, and three 
  1762. 16-bit conventions: 
  1763.  
  1764.  32-bit:                     16-bit: 
  1765.     _Optlink                    _Far16 _cdecl 
  1766.     _System                     _Far16 _Pascal 
  1767.     _Pascal                     _Far16 _Fastcall 
  1768.     _Far32 _Pascal 
  1769.  _cdecl 
  1770.  _stdcall 
  1771.  
  1772.  Note:  The _Far32 _Pascal convention can only be used in C programs and only 
  1773.         when the /Gr+ option is specified. 
  1774.  
  1775.  The default is _Optlink for calls to 32-bit code. You must explicitly specify 
  1776.  a calling convention for all 16-bit calls. If you specify only _Far16, the 
  1777.  convention defaults to _Far16 _cdecl. You can change the default for 32-bit 
  1778.  code to _System by using the /Ms compiler option. The /Mp option explicitly 
  1779.  sets the calling convention to _Optlink. 
  1780.  
  1781.  You can also set the calling convention for individual functions using linkage 
  1782.  keywords. For example, to declare sample as a function with the _System 
  1783.  calling convention, you could use the following statement: 
  1784.  
  1785.        int _System sample(int i);
  1786.  
  1787.  Note:  You cannot change the calling convention for C++ member functions. 
  1788.         Member functions always use the _Optlink convention. 
  1789.  
  1790.  Related Tasks: 
  1791.  
  1792.      How do I set compiler options using WorkFrame 
  1793.      How do I set linker options using WorkFrame 
  1794.      How do I compile from the command line 
  1795.      How do I compile from within WorkFrame 
  1796.  
  1797.  Related Information: 
  1798.  
  1799.      The Calling Conventions section of the Programming Guide 
  1800.  
  1801.  
  1802. ΓòÉΓòÉΓòÉ 10.17. Setting the stack size ΓòÉΓòÉΓòÉ
  1803.  
  1804. You can set the stack size in one of three ways: 
  1805.  
  1806.      Specify the /B"/STACK:size" compiler option. 
  1807.      Specify the /STACK:size linker option when you invoke the linker from the 
  1808.       command line. 
  1809.      Specify the STACKSIZE statement in a module definition (.DEF) file for 
  1810.       the first thread of an application; use the _beginthread function call 
  1811.       for threads created later. 
  1812.  
  1813.  The default stack size is 32K for the first thread. Setting the stack size 
  1814.  using one of the options listed above overrides the default value. For 
  1815.  example, specifying the linker option: 
  1816.  
  1817.        /STACK:65536
  1818.  
  1819.  sets the stack size to be 64K. 
  1820.  
  1821.  If your program calls 16-bit code, you can set the stack for the 16-bit code 
  1822.  using the #pragma stack16 directive. Because the 16-bit stack is allocated 
  1823.  from the 32-bit stack, you must ensure that the 32-bit stack is large enough 
  1824.  for both your 32-bit and 16-bit code. 
  1825.  
  1826.  Related Tasks: 
  1827.  
  1828.      How do I set compiler options using WorkFrame 
  1829.      How do I set linker options using WorkFrame 
  1830.      How do I compile from the command line 
  1831.      How do I compile from within WorkFrame 
  1832.  
  1833.  
  1834. ΓòÉΓòÉΓòÉ 11. Create Diskettes from CD-ROM ΓòÉΓòÉΓòÉ
  1835.  
  1836. The VisualAge C++ CD-ROM contains diskette images for 3.5 inch 1.44 MB format 
  1837. diskettes. The images are located in the IMAGES directory on the CD-ROM. You 
  1838. can create diskettes from these images to use as a backup to the CD-ROM, or to 
  1839. install on a machine without a CD-ROM drive: 
  1840.  
  1841. Important:  If you create diskettes to install on other workstations, make sure 
  1842.             you observe the license agreement as described in the License 
  1843.             Information booklet. 
  1844.  
  1845.    1. Access the CD-ROM drive and change to the IMAGES directory. 
  1846.    2. Insert a 3.5 inch diskette in your diskette drive. Note that you can use 
  1847.       5.25 inch diskettes, but you must specify the /C option on the LOADDSKF 
  1848.       command in the next step. 
  1849.    3. Copy the first diskette image (DISK1.IMG) to the diskette using the 
  1850.       LOADDSKF utility, which is also located in the IMAGES directory. See 
  1851.       below for syntax of the LOADDSKF command. 
  1852.    4. Remove the diskette and label it Diskette 1. 
  1853.    5. Repeat steps 2 to 4 for each of the diskette images. 
  1854.  
  1855.  LOADDSKF runs on both DOS and OS/2, and the general syntax is: 
  1856.  
  1857.      LOADDSKF [d:\path\]diskette.img a: [options]
  1858.  
  1859.  Where: 
  1860.  
  1861.  d:\path\    Is the path of the diskette image file (in this case, the IMAGES 
  1862.              directory). 
  1863.  diskette.img Is the name of the diskette image file. 
  1864.  a:          Is the diskette drive where the target diskette is. 
  1865.  options     Are any of the following: 
  1866.     /F        Format the target diskette to match the diskette image format. 
  1867.     /Y        Skip the prompt of user input (y/n) when overwriting the 
  1868.              diskette. 
  1869.     /Y /Q     Skip the warning message when overwriting the diskette. 
  1870.     /S        Do not beep when diskette has been created (silent mode). 
  1871.     /C        Create 5.25 inch diskettes from the 3.5 inch images. 
  1872.  
  1873.  We recommend that you use the /F option to ensure that your diskette images 
  1874.  are formatted correctly; you may want to use the other options for 
  1875.  convenience. 
  1876.  
  1877.  
  1878. ΓòÉΓòÉΓòÉ 12. Create Files ΓòÉΓòÉΓòÉ
  1879.  
  1880. You can create the following files (Note that this is not an exhaustive list): 
  1881.  
  1882.      A compiler listing 
  1883.      Header files to work with both C and C++ 
  1884.      A Module Definition file 
  1885.      An .EXE file 
  1886.      An .OBJ file 
  1887.      A device driver (.SYS) 
  1888.      Make files and dependency files 
  1889.      Library (.LIB) files 
  1890.      Runtime library (.DLL) files 
  1891.      Your own message files 
  1892.      A WorkFrame project 
  1893.  
  1894.  Related Information 
  1895.  
  1896.      The Programming Guide 
  1897.      The User's Guide 
  1898.  
  1899.  
  1900. ΓòÉΓòÉΓòÉ 12.1. Creating a compiler listing ΓòÉΓòÉΓòÉ
  1901.  
  1902.  
  1903. ΓòÉΓòÉΓòÉ 12.2. Creating header files to work with both C and C++ ΓòÉΓòÉΓòÉ
  1904.  
  1905. Follow these guidelines to enable your new header files to work with both C and 
  1906. C++ code: 
  1907.  
  1908.    1. Rename any C or C++ specific keywords. 
  1909.    2. Add to the beginning of each header file: 
  1910.          #if __cplusplus 
  1911.          extern "C" { 
  1912.          #endif 
  1913.    3. Add to the end of each header file: 
  1914.          #if __cplusplus 
  1915.          } 
  1916.          #endif 
  1917.    4. Do not use _Packed in your code; use #pragma pack instead. 
  1918.    5. Do not use #pragma linkage in your code; use the linkage convention 
  1919.       keywords instead. 
  1920.    6. Use typedefs for structures to be passed to 16-bit code and specify the 
  1921.       typedef in a #pragma seg16 directive. 
  1922.    7. Specify the linkage on any identifiers that are pointers to functions. 
  1923.    8. Use the _Seg16 type qualifier to declare external pointers that will be 
  1924.       shared between 32-bit and 16-bit code (and are declared in both). The 
  1925.       _Seg16 qualifier directs the compiler to store the pointer as a segmented 
  1926.       pointer (with a 16-bit selector and 16-bit offset) that can be used 
  1927.       directly by a 16-bit application. You can also use the pointer in a 
  1928.       32-bit program; the VisualAge C++ compiler automatically converts it to a 
  1929.       flat 32-bit pointer when necessary. 
  1930.  
  1931.  
  1932. ΓòÉΓòÉΓòÉ 12.3. Creating a module definition file ΓòÉΓòÉΓòÉ
  1933.  
  1934.  
  1935. ΓòÉΓòÉΓòÉ 12.4. Creating an .EXE file ΓòÉΓòÉΓòÉ
  1936.  
  1937.  
  1938. ΓòÉΓòÉΓòÉ 12.5. Creating an .OBJ file ΓòÉΓòÉΓòÉ
  1939.  
  1940.  
  1941. ΓòÉΓòÉΓòÉ 12.6. Creating make files and dependency files ΓòÉΓòÉΓòÉ
  1942.  
  1943. You could write your own make file, or use the WorkFrame MakeMake utility from 
  1944. either the WorkFrame project environment or from the command line. Both methods 
  1945. are described below. 
  1946.  
  1947. From a WorkFrame project: 
  1948.  
  1949.    1. Select MakeMake from the Project PullDown menu. The MakeMake window 
  1950.       appears. 
  1951.    2. In the Actions ListBox, select the actions necessary for building the 
  1952.       target of your project. 
  1953.    3. In the Source Files ListBox, select the source files on which the first 
  1954.       action in the Actions ListBox is to be performed. 
  1955.    4. Select the Start PushButton. A window appears with the generated make 
  1956.       file. You can edit the make file from this window. Note that this window 
  1957.       will be in the form of a NoteBook if a dependency file was generated as 
  1958.       well. In this case, use the NoteBook tabs to switch between the make file 
  1959.       and the dependency file. 
  1960.  
  1961.  From the command line: 
  1962.  
  1963.  Enter makemake [options] on the command line, where options can be: 
  1964.  
  1965.  /P <project> Specifies the name of the project to be processed. You can use 
  1966.          the path name or its persistent object ID (found in the /DESKTOP 
  1967.          directory). 
  1968.  /A <action> Specifies the action to be used to build the target in the form 
  1969.          <action class>::<action name>. This option can be repeated if you have 
  1970.          more than one build action to specify. 
  1971.  /NOD    Do not display the MakeMake window. 
  1972.  /NOP    Do not prompt via Message boxes. All errors are returned as error 
  1973.          codes. 
  1974.  /F      Force the overwriting of make files regardless of whether the make 
  1975.          file was modified since its last generation. 
  1976.  /S      Generate a separate dependency file. 
  1977.  /D      Save only the dependency file. Do not save the make file. 
  1978.  
  1979.  Related Information: 
  1980.  
  1981.      The MakeMake section of the User's Guide 
  1982.  
  1983.  
  1984. ΓòÉΓòÉΓòÉ 12.7. Creating .LIB files ΓòÉΓòÉΓòÉ
  1985.  
  1986. ;i2 refid=files.library (.LIB), creating 
  1987.  
  1988. To create a new library file, use the ILIB utility. The syntax for the ILIB 
  1989. utility is: 
  1990.  
  1991.    ILIB [library]
  1992.  
  1993. Specify the name of the library file you want to create on the command line (or 
  1994. at the Library name: prompt when using ILIB prompts). 
  1995.  
  1996. Note:  A library file is automatically created if the library file name you 
  1997.        specify is immediately followed by a command, comma, or semicolon. In 
  1998.        this case, the prompt does not appear. 
  1999.  
  2000.  Note that if the name you specify for the new library file already exists, 
  2001.  ILIB assumes that you want to modify the existing file. 
  2002.  
  2003.  Related Information: 
  2004.  
  2005.      The Creating and Maintaining Libraries with ILIB section of the User's 
  2006.       Guide 
  2007.  
  2008.  
  2009. ΓòÉΓòÉΓòÉ 12.8. Creating .DLL files ΓòÉΓòÉΓòÉ
  2010.  
  2011.  
  2012. ΓòÉΓòÉΓòÉ 12.9. Creating my own message files ΓòÉΓòÉΓòÉ
  2013.  
  2014. You can use the MKMSGF program provided in the Toolkit. The MKMSGF program 
  2015. reads the input message file that you specify, and creates an output message 
  2016. file that DosGetMessage uses to display messages. At the OS/2 command prompt, 
  2017. enter: 
  2018.  
  2019.    MKMSGF infile.txt outfile.msg [options]
  2020.  
  2021. Use the outfile.msg file with DosGetMessage to display the message in your 
  2022. application. 
  2023.  
  2024. To see quick help on the MKMSGF program, enter MKMSGF /? on the OS/2 command 
  2025. line. 
  2026.  
  2027. Related Information: 
  2028.  
  2029.      The Toolkit Reference. 
  2030.  
  2031.  
  2032. ΓòÉΓòÉΓòÉ 12.10. Creating a WorkFrame project ΓòÉΓòÉΓòÉ
  2033.  
  2034.  
  2035. ΓòÉΓòÉΓòÉ 13. Create Data Access Methods ΓòÉΓòÉΓòÉ
  2036.  
  2037. Data Access Builder is an application development tool that you can use to 
  2038. create data access methods. Use these generated methods with the Data Access 
  2039. Builder classes which make up part of the VisualAge C++ Open Class Library to 
  2040. access a DB2/2 relational database. 
  2041.  
  2042. Using the Data Access Builder tools, you map your existing relational database 
  2043. tables to object interfaces. In a simple case, a relational database table maps 
  2044. to a class, and a column of the table maps to a class attribute. Once you have 
  2045. defined your mapping, you can generate code based on it. Note that the C++ 
  2046. objects that you create can be imported into the VisualAge C++ Visual Builder. 
  2047.  
  2048. You can start Data Access Builder using any of the following methods: 
  2049.  
  2050.      Double click on the Data Access Builder icon in the VisualAge C++ Tools 
  2051.       folder. 
  2052.      Type icsdata.exe from an OS/2 command line, and press Enter. 
  2053.      From the PopUp menu on a WorkFrame project icon (for which the project 
  2054.       uses the Data Access Builder actions profile), select from the Actions 
  2055.       Cascade menu 
  2056.      Choose the DATABASE Cascade menu from any Project PullDown menu of any 
  2057.       WorkFrame-integrated tool that uses the Data Access Builder actions 
  2058.       profile. 
  2059.  
  2060.  Related Information: 
  2061.  
  2062.      The Data Access Builder How Do I... information 
  2063.      The Data Access Builder User's Guide 
  2064.      The Visual Builder How Do I... information 
  2065.      The Visual Builder User's Guide 
  2066.      The Visual Builder Parts Reference 
  2067.  
  2068.  
  2069. ΓòÉΓòÉΓòÉ 14. Create Help and Message Files ΓòÉΓòÉΓòÉ
  2070.  
  2071. You can create the following (Note that this is not an exhaustive list): 
  2072.  
  2073.      Your own message files 
  2074.      Online help for applications 
  2075.      Online documentation 
  2076.  
  2077.  
  2078. ΓòÉΓòÉΓòÉ 14.1. Creating my own message files ΓòÉΓòÉΓòÉ
  2079.  
  2080.  
  2081. ΓòÉΓòÉΓòÉ 14.2. Writing online help for applications ΓòÉΓòÉΓòÉ
  2082.  
  2083. You create the source information in the same manner as you would create online 
  2084. documentation. However, you must create help tables which map the resource 
  2085. number of the user interface objects to the actual information tables. 
  2086.  
  2087. For more information on how to do this, see the Information Presentation 
  2088. Facility (IPF) Guide and Reference. 
  2089.  
  2090. Related Tasks: 
  2091.  
  2092.      How do I create online documentation 
  2093.  
  2094.  
  2095. ΓòÉΓòÉΓòÉ 14.3. Creating online documentation ΓòÉΓòÉΓòÉ
  2096.  
  2097. The Information Presentation Facility (IPF) is a Toolkit tool that you can use 
  2098. to create online information, to specify how it will appear on the screen, to 
  2099. connect various parts of the information, and to provide help information that 
  2100. can be requested by the user.  IPF features include: 
  2101.  
  2102.      A tagging language lets you specify the format of text and provides a way 
  2103.       to connect information and customize the information display. 
  2104.      A compiler that creates online documents and help windows. 
  2105.      A viewing program (view.exe) that displays formatted online documents 
  2106.       (view).  This program is part of the OS/2 operating system. 
  2107.  
  2108.  The syntax for the IPF compiler command is: 
  2109.  
  2110.   IPFC source_file [/options] [output_message_file]
  2111.  
  2112.  Enabling help for applications requires programming code that communicates 
  2113.  with IPF and with the PM APIs to display help windows. 
  2114.  
  2115.  For more information on how to do this, see the Information Presentation 
  2116.  Facility (IPF) Guide and Reference. 
  2117.  
  2118.  
  2119. ΓòÉΓòÉΓòÉ 15. Debug my Heaps ΓòÉΓòÉΓòÉ
  2120.  
  2121. VisualAge C++ provides two sets of functions for debugging your heap usage: 
  2122.  
  2123.      Debug versions of all memory management functions 
  2124.      Heap-checking functions similar to those provided by other compilers 
  2125.  
  2126.  Which should you use? 
  2127.  
  2128.  Both sets of debugging functions have their benefits and drawbacks. Which 
  2129.  function you choose to use depends on your program, your problem, and your 
  2130.  preference. For example, you could add calls to heap-checking functions in 
  2131.  places where you suspect possible memory problems. If the heap turns out to be 
  2132.  corrupted, then you may want to rebuild with the /Tm option. 
  2133.  
  2134.  
  2135. ΓòÉΓòÉΓòÉ 15.1. Debugging heaps using debug versions ΓòÉΓòÉΓòÉ
  2136.  
  2137. The debug version calls _uheap_check to check the heap used in the call, and 
  2138. records the file and line number where the memory was allocated or freed. You 
  2139. can then use _dump_allocated or _dump_allocated_delta to display information 
  2140. about currently allocated memory blocks. Information is printed to stderr; you 
  2141. can change the destination with the _set_crt_msg_handle function. 
  2142.  
  2143. You can use debug memory management functions for any type of heap, including 
  2144. tiled and shared memory. To use debug versions, specify the /Tm option. 
  2145.  
  2146. If you parenthesize the name of a memory management function, the function is 
  2147. not mapped to the debug version; however, this does not apply to the C++ new 
  2148. and delete functions, which are mapped to their debug versions regardless of 
  2149. parentheses. 
  2150.  
  2151. You can specify both /Gt and /Tm together, to map regular memory management 
  2152. functions to tiled debug versions (for example, _debug_tmalloc). 
  2153.  
  2154. Note:  You can mix debug and non-debug memory management functions. 
  2155.  
  2156.  
  2157. ΓòÉΓòÉΓòÉ 15.2. Debugging heaps using heap-checking functions ΓòÉΓòÉΓòÉ
  2158.  
  2159. VisualAge C++ also provides new functions for validating your heaps: _uheapchk, 
  2160. _uheapset, and _uheap_walk. Both _uheapchk and _uheapset check the specified 
  2161. heap for minimal consistency; _uheapchk checks the entire heap, while _uheapset 
  2162. checks only the free memory. _uheapset also sets the free memory in the heap to 
  2163. a value that you specify. _uheap_walk traverses the heap and provides 
  2164. information about each allocated or freed object to a callback function that 
  2165. you provide. You can then use the information in a way that you like. 
  2166.  
  2167. These heap-checking functions are defined in umalloc.h, while the regular 
  2168. versions of these functions are defined in malloc.h. 
  2169.  
  2170. Note:  These heap-checking functions are not controlled by a compiler option, 
  2171.        so you can use them in your program at any time. 
  2172.  
  2173.  
  2174. ΓòÉΓòÉΓòÉ 16. Debug my Programs ΓòÉΓòÉΓòÉ
  2175.  
  2176. The VisualAge C++ Debugger uses Presentation Manager (PM) window services to 
  2177. help detect and diagnose errors in code developed in IBM 32-bit C/C++. 
  2178.  
  2179. Use the Debugger to run your program, set breakpoints, examine message queues, 
  2180. and monitor variables, registers, storage and the call stack. 
  2181.  
  2182. To start the Debugger: 
  2183.  
  2184.      Double-click on the Debugger icon found in the Tools folder which is 
  2185.       located in the VisualAge C++ desktop folder. 
  2186.      From the WorkFrame project environment, select Debug from the WorkFrame 
  2187.       PullDown menu. 
  2188.      From other components of VisualAge C++, select Debug from the Project 
  2189.       PullDown menu. 
  2190.      From the command line, type: icsdebug. 
  2191.  
  2192.  Related Tasks: 
  2193.  
  2194.      How do I compile for debugging 
  2195.      How do I link for debugging 
  2196.  
  2197.  Related Information: 
  2198.  
  2199.      The Debugger How Do I... information 
  2200.      The Debugging section of the User's Guide 
  2201.  
  2202.  
  2203. ΓòÉΓòÉΓòÉ 17. Delete/Add VisualAge C++ Components ΓòÉΓòÉΓòÉ
  2204.  
  2205.  
  2206. ΓòÉΓòÉΓòÉ 18. Determine What Classes are in the Open Class Library ΓòÉΓòÉΓòÉ
  2207.  
  2208. Use the VisualAge C++ Browser facility to determine which classes are contained 
  2209. in the VisualAge C++ Open Class Library. From the Browser Load  Cascade menu 
  2210. located on the File PullDown menu, select the type of class that you want to 
  2211. look for: 
  2212.  
  2213.      Application Support Classes 
  2214.      Complex Mathematics Classes 
  2215.      Collection Classes 
  2216.      Database Access Classes 
  2217.      I/O Stream Classes 
  2218.      User Interface Classes 
  2219.  
  2220.  Selecting one of the above will produce a list of all classes defined for that 
  2221.  group of classes. 
  2222.  
  2223.      You can use the Browser to graphically view the entire structure of these 
  2224.       classes, by choosing the Show Inheritance Graph menu item from the 
  2225.       Actions PullDown menu. 
  2226.      You can view the members of a class and its base classes by clicking 
  2227.       Mouse Button 2 on any class object and selecting the List Members with 
  2228.       Inheritance menu item. 
  2229.      You can view the include file graph by selecting the Show Include File 
  2230.       Graph menu item from the Actions PullDown menu. 
  2231.      You can see the definition of a class, function, type or variable by 
  2232.       clicking Mouse Button 2 on the object and choosing the Edit Definition 
  2233.       menu item. 
  2234.      You can list all defined objects in a file by clicking Mouse Button 2 on 
  2235.       a file object and selecting the List Defined Objects menu item. 
  2236.      You can list the implementing file of a class by selecting the class with 
  2237.       Mouse Button 2 and choosing the List Implementing Files menu item. 
  2238.  
  2239.  Related Information: 
  2240.  
  2241.      The Browser section of the User's Guide 
  2242.      The Browser How Do I... Information 
  2243.      The Open Class Library User's Guide 
  2244.      The Open Class Library Reference 
  2245.  
  2246.  
  2247. ΓòÉΓòÉΓòÉ 19. Develop with WorkFrame ΓòÉΓòÉΓòÉ
  2248.  
  2249. To use WorkFrame, you must first create a project. If you have existing 
  2250. projects, you can: 
  2251.  
  2252.      Copy a WorkFrame project to diskette 
  2253.      Migrate old WorkFrame projects 
  2254.  
  2255.  You can perform all tool activities from within WorkFrame: 
  2256.  
  2257.      Edit your source code 
  2258.      Compile from within WorkFrame 
  2259.      Link from within WorkFrame 
  2260.      Debug your programs 
  2261.      Analyze performance 
  2262.      Browse your programs 
  2263.      Map existing relational database tables to object interfaces 
  2264.  
  2265.  You can also set compiler and linker settings from within the WorkFrame 
  2266.  environment: 
  2267.  
  2268.      Set compiler options using WorkFrame 
  2269.      Set linker options using WorkFrame 
  2270.  
  2271.  Note:  This is not an exhaustive list of tasks used to develop with WorkFrame. 
  2272.  
  2273.  Related Information: 
  2274.  
  2275.      The WorkFrame How Do I... information 
  2276.      The WorkFrame section of the User's Guide 
  2277.  
  2278.  
  2279. ΓòÉΓòÉΓòÉ 19.1. Creating WorkFrame projects ΓòÉΓòÉΓòÉ
  2280.  
  2281. To quickly create WorkFrame projects: 
  2282.  
  2283.    1. Open the VisualAge C++ desktop folder. 
  2284.    2. Double-click on the Project Smarts object to open a catalog of project 
  2285.       skeletons for common types of application. 
  2286.    3. Choose the type of application you want to create from the catalog by 
  2287.       double-clicking on the listed item. 
  2288.    4. Click on the Create PushButton to continue with the specification of your 
  2289.       new project. 
  2290.  
  2291.  Alternatively: 
  2292.  
  2293.    1. Open the Templates folder (usually located on your desktop). 
  2294.    2. Drag a WorkFrame Project icon onto your desktop to create a project icon 
  2295.       on your desktop. 
  2296.  
  2297.  In either case, you can further customize the created project. 
  2298.  
  2299.  Related Information: 
  2300.  
  2301.      The WorkFrame section of the User's Guide 
  2302.      The WorkFrame How Do I... information 
  2303.  
  2304.  
  2305. ΓòÉΓòÉΓòÉ 19.2. Copying a WorkFrame project to diskette ΓòÉΓòÉΓòÉ
  2306.  
  2307. If your project is not very large: 
  2308.  
  2309.    1. On the source machine, drag the project icon onto your diskette drive 
  2310.       icon. If there is a diskette in the drive, the project will be copied. 
  2311.    2. On the target machine, insert the copied diskette. 
  2312.    3. Double-click on the diskette drive icon. 
  2313.    4. Drag the project icon to the desktop. 
  2314.  
  2315.  If you have a very large project, then you can compress the project, and split 
  2316.  the compressed file across several diskettes, if required: 
  2317.  
  2318.    1. Compress the project using a compression program that preserves extended 
  2319.       file attributes (such as zip and unzip programs). Project files are found 
  2320.       in the \DESKTOP directory on your boot drive. 
  2321.    2. If your compressed file is very large and your compression program 
  2322.       supports splitting files, you can split the compressed file into smaller 
  2323.       files to fit on diskette. 
  2324.    3. Copy the compressed file(s) onto a diskette. 
  2325.    4. Uncompress the file(s) under the \DESKTOP directory on the target 
  2326.       machine. 
  2327.  
  2328.  
  2329. ΓòÉΓòÉΓòÉ 19.3. Migrating old WorkFrame projects ΓòÉΓòÉΓòÉ
  2330.  
  2331. If you have WorkFrame projects that were created in WorkFrame Version 1.x or 
  2332. Version 2.x, and want to transform them into the format that the current 
  2333. version uses: 
  2334.  
  2335.    1. Double-click on the Migrate Projects icon found in the Tools folder of 
  2336.       the VisualAge C++ desktop folder. 
  2337.    2. Decide whether you want to migrate projects from Version 1.x or Version 
  2338.       2.x. 
  2339.    3. Decide which projects you want to migrate. The original projects are not 
  2340.       modified. The new projects are put into a Migration folder on the 
  2341.       desktop. 
  2342.    4. Decide if you want to migrate just the basic project settings, or the 
  2343.       settings and the action profiles (which determine the contents of the 
  2344.       PopUp and PullDown menus). Because WorkFrame Version 3.0 defines many 
  2345.       default actions, you might want to migrate just the project itself, 
  2346.       unless you have customized the action profiles significantly. 
  2347.    5. To migrate WorkFrame Version 1.x projects: Select the Change Directory 
  2348.       PushButton to locate the directories where the projects are located. When 
  2349.       you select OK, the migration process is started. 
  2350.    6. To migrate WorkFrame Version 2.x projects: Select the drives on which the 
  2351.       projects are located, and select the Find Projects PushButton to find the 
  2352.       projects. Once you have found one or more projects, select the ones you 
  2353.       want to migrate, and select the Migrate PushButton to perform the 
  2354.       automatic phase of the migration. 
  2355.    7. After the automatic migration is finished, follow these manual steps for 
  2356.       each project: 
  2357.         a. Archive the old version (optional). 
  2358.         b. Rename the new version and move to another folder (optional). 
  2359.  
  2360.  Related Information: 
  2361.  
  2362.      The WorkFrame section of the User's Guide 
  2363.      The WorkFrame How Do I... information 
  2364.  
  2365.  
  2366. ΓòÉΓòÉΓòÉ 19.4. Compiling from within WorkFrame ΓòÉΓòÉΓòÉ
  2367.  
  2368.  
  2369. ΓòÉΓòÉΓòÉ 19.5. Linking from within WorkFrame ΓòÉΓòÉΓòÉ
  2370.  
  2371.  
  2372. ΓòÉΓòÉΓòÉ 19.6. Setting compiler options using WorkFrame ΓòÉΓòÉΓòÉ
  2373.  
  2374. If you have installed the WorkFrame product, you can set options as follows: 
  2375.  
  2376.    1. Double-click on the project icon to open the WorkFrame project 
  2377.       environment. 
  2378.  
  2379.    2. From the Options menu, select the Build Smarts menu item. The Build 
  2380.       Smarts window appears, in which you can select a standard task you want 
  2381.       to build for. The options appropriate for that task are set automatically 
  2382.       when you select the OK PushButton. 
  2383.  
  2384.       If you want to set options on an individual basis, as well as by general 
  2385.       task, then do the following: 
  2386.  
  2387.         a. Select the Compiler menu item from the Options PullDown menu to 
  2388.            display the Compiler Options NoteBook. 
  2389.  
  2390.         b. Select options in the NoteBook. Turn the pages to see all the 
  2391.            options (there can be several pages under one tab). 
  2392.  
  2393.         c. Select the OK PushButton when you are done. 
  2394.  
  2395.  The next time you build your project, the options you selected are used. 
  2396.  
  2397.  Related Information: 
  2398.  
  2399.      The WorkFrame section of the User's Guide 
  2400.      The WorkFrame How Do I... information 
  2401.  
  2402.  
  2403. ΓòÉΓòÉΓòÉ 19.7. Setting linker options using WorkFrame ΓòÉΓòÉΓòÉ
  2404.  
  2405. If you have installed the WorkFrame product, you can set linker options using 
  2406. the options dialogs. You can use the dialogs when you create or modify a 
  2407. project. 
  2408.  
  2409.      Double-click on the project icon to open the WorkFrame project 
  2410.       environment. 
  2411.      Select the Linker menu item from the Options PullDown menu to display the 
  2412.       Linker Options NoteBook. 
  2413.      Select options in the NoteBook. Turn the pages to see all the options 
  2414.       (there can be several pages under one tab). 
  2415.      Select the OK PushButton when you are done. 
  2416.  
  2417.  Options you select while creating or changing a project are saved with that 
  2418.  project. 
  2419.  
  2420.  Related Information: 
  2421.  
  2422.      The WorkFrame section of the User's Guide 
  2423.      The WorkFrame How Do I... information 
  2424.  
  2425.  
  2426. ΓòÉΓòÉΓòÉ 20. Edit Files ΓòÉΓòÉΓòÉ
  2427.  
  2428. The VisualAge C++ Editor can be used to edit all kinds of files, including C 
  2429. and C++ files. You can also use the Editor to start other tasks, by selecting 
  2430. choices from the Project or Browser PullDown menus. From the editor, you can 
  2431. perform a wide variety of tasks, including compiling, linking, debugging, and 
  2432. browsing your program. 
  2433.  
  2434. To start the Editor: 
  2435.  
  2436.      Select the Editor icon from the Tools folder located in the VisualAge C++ 
  2437.       desktop folder. 
  2438.      Select the Edit menu item from any tools Project PullDown menu. 
  2439.      With Mouse Button 2, select a file object in the WorkFrame environment, 
  2440.       and select the Edit menu item from the PopUp menu. 
  2441.  
  2442.  Related Information: 
  2443.  
  2444.      The Editor How Do I... Information 
  2445.      The Editor section of the User's Guide 
  2446.  
  2447.  
  2448. ΓòÉΓòÉΓòÉ 21. Get Support ΓòÉΓòÉΓòÉ
  2449.  
  2450. To contact VisualAge C++ Service and Support: 
  2451.  
  2452. Telephone Support in the USA and Canada 
  2453.  
  2454. VisualAge C++ has a free 60-day Getting Started period (GSP) to help you with 
  2455. installation, usage, and how-to problems. Call 1-800-237-5511. The 60-day 
  2456. period starts on the date of your first call, and is offered 9am to 5pm (in 
  2457. your time zone), Monday through Friday. If you need service outside of these 
  2458. hours during the GSP, services charges apply. Call 1-800-237-5511 for details. 
  2459.  
  2460. After your 60-day GSP, we offer a wide menu of service options tailored to a 
  2461. full spectrum of customer needs. Again, call 1-800-237-5511 for details. 
  2462.  
  2463. Quite often, you may not need a technical support, for example when you have 
  2464. questions about CSD levels and availability, registration cards, or beta tests. 
  2465. In recognition of these questions, our automated response system contains a 
  2466. wealth of useful information. You can also receive much of that information by 
  2467. fax. The response system is available 24 hours a day, 7 days a week. Call 
  2468. 1-800-668-2853. (Outside of North America, you can access the same system at 
  2469. 416-448-4363). 
  2470.  
  2471. Telephone Support Outside North America 
  2472.  
  2473. For local country support, please contact your IBM branch for details. 
  2474.  
  2475. Electronic Support - Worldwide 
  2476.  
  2477. You can also contact VisualAge C++ Support electronically. There is no charge 
  2478. for this service, other than what you normally pay for your electronic access. 
  2479.  
  2480.      Compuserve (OS2DF1) 
  2481.      INTERNET 
  2482.         -  va_cpp@vnet.ibm.com 
  2483.         -  workframe@vnet.ibm.com for WorkFrame-specific questions 
  2484.      IBMLink/ServiceLink 
  2485.         -  VA C++ forum 
  2486.         -  ETR (electronic reporting of problems) 
  2487.      TalkLink 
  2488.         -  VA C++ forum 
  2489.         -  ETR (electronic reporting of problems) 
  2490.  
  2491.  If you frequent the Internet, you can also contact other knowledgeable 
  2492.  VisualAge C++ users on the USENET newsgroups. (VisualAge C++ discussions often 
  2493.  appear in the comp.os.os2.programmer hierarchy). 
  2494.  
  2495.  Other Defect Reporting Channels in the USA and Canada 
  2496.  
  2497.  You can also report possible VisualAge C++ code-related problems using any of 
  2498.  the following methods: 
  2499.  
  2500.      FAX: 
  2501.          1-800-426-8602 
  2502.      MAIL: 
  2503.          IBM Corp 
  2504.          Personal Systems Support Family 
  2505.          11400 Burnet Road 
  2506.          Internal Zip 2901 
  2507.          AUSTIN, TX  78758 
  2508.      ELECTRONIC: 
  2509.          CompuServe - 76711,611 
  2510.  
  2511.  Other Defect Reporting Channels Outside the USA and Canada 
  2512.  
  2513.  Other IBM countries offer mail-in and fax support. Please contact your IBM 
  2514.  branch for details. 
  2515.  
  2516.  
  2517. ΓòÉΓòÉΓòÉ 22. Improve Compiler Performance ΓòÉΓòÉΓòÉ
  2518.  
  2519. You can speed up some compilations by doing one or all of the following: 
  2520.  
  2521.      If the VisualAge C++ directories are at the end of the LIBPATH, PATH, 
  2522.       INCLUDE, and so on, the compiler or linker must first search through all 
  2523.       of the other directories before it finds the required DLLs, header files, 
  2524.       and so on. Therefore, the compiler and linker will find the VisualAge C++ 
  2525.       directories faster if you move them to the beginning of LIBPATH, PATH, 
  2526.       INCLUDE, etc.. 
  2527.  
  2528.      Ensure that the compiler is preloaded with the /Tl option (it is 
  2529.       preloaded by default). This option keeps the compiler components loaded 
  2530.       in memory. 
  2531.  
  2532.      If you are using static linking to the VisualAge C++ libraries, try 
  2533.       dynamic linking. 
  2534.  
  2535.      Use precompiled header files. See the User's Guide for details on how to 
  2536.       structure your files so the compiler can take full advantage of the 
  2537.       precompiled headers. 
  2538.  
  2539.      Turn off all optimizations. 
  2540.  
  2541.      If you are using the HPFS file system, set the IFS statement in your 
  2542.       config.sys file to: 
  2543.  
  2544.                IFS=c:\os2\hpfs.ifs /cache:2048 /crecl:64
  2545.  
  2546.       This allows OS/2 to keep frequently-used header files in memory between 
  2547.       compilation, which can greatly reduce the amount of time it requires the 
  2548.       compiler to process them. 
  2549.  
  2550.      Add more RAM to your system. In a memory-constrained environment, OS/2 
  2551.       spends more time swapping data to disk, which increases compilation times 
  2552.       tremendously. Additional RAM allows the compiler and its data to remain 
  2553.       in memory, which can make your builds run more quickly. 
  2554.  
  2555.      Define a virtual disk (VDISK or RAM disk) with the OS/2 VDISK device 
  2556.       driver. It creates a disk from your system's RAM. For example, placing 
  2557.       this statement in your config.sys file: 
  2558.  
  2559.                DEVICE=C:\OS2\VDISK.SYS 2048,,256
  2560.       allocates a virtual disk of 2M with 256 directory entries. You can then 
  2561.       copy all the library and header files you need for compiling and linking 
  2562.       to this disk and set your LIB and INCLUDE variables to point to it before 
  2563.       any other directory. Because these files are already in memory, your 
  2564.       compile and link times will improve. (Do not put the compiler executable 
  2565.       files there; the compiler preloads them into memory by default, so you 
  2566.       would then have two copies in memory.) 
  2567.  
  2568.       However, there are drawbacks to using a VDISK. The data on it is lost 
  2569.       when you reboot. Also, memory allocated for a VDISK is unswappable memory 
  2570.       space, meaning it cannot be used as normal memory space by applications. 
  2571.       Because C++ compilations can require a lot of memory, putting memory into 
  2572.       a VDISK could cause excessive memory paging and slow down your 
  2573.       compilation. If you have a large VDISK, it may be to your advantage to 
  2574.       eliminate it or make it smaller to provide more available memory to the 
  2575.       compiler 
  2576.  
  2577.      Minimize dependencies between source files so that changes made to one 
  2578.       file don't require you to recompile all your files. 
  2579.  
  2580.      For C++ programs specifically: 
  2581.  
  2582.         -  Create abstract objects that contain only public methods and make 
  2583.            your real objects descendents of those objects. This approach 
  2584.            reduces the amount of total source code in compiles that do not need 
  2585.            to refer to the real objects. 
  2586.         -  In .HPP files, only include those files you need. 
  2587.  
  2588.       For example, if all that the .HPP file for class B needs to know about 
  2589.       class A is that class B contains a pointer to a class A-type object, put 
  2590.       class a; (rather than #include "a.hpp") in B.HPP. 
  2591.  
  2592.       Note:  This approach would still allow you to put #include "a.hpp" in 
  2593.              B.CPP. 
  2594.  
  2595.  
  2596. ΓòÉΓòÉΓòÉ 23. Learn About SOM and DirectToSOM ΓòÉΓòÉΓòÉ
  2597.  
  2598. System Object Model (SOM) defines an interface between programs, or between 
  2599. libraries and programs, so that an object's interface is separated from its 
  2600. implementation. SOM allows classes of objects to be defined in one programming 
  2601. language and used in another, and it allows libraries of such classes to be 
  2602. updated without requiring client code to be recompiled. 
  2603.  
  2604. To learn all about SOM, see the IBM System Object Model Programming Guide. 
  2605.  
  2606.  
  2607. ΓòÉΓòÉΓòÉ 24. Learn More About Object-Oriented Programming ΓòÉΓòÉΓòÉ
  2608.  
  2609. Many books have been written about the C++ language and related programming 
  2610. topics. The authors use varying approaches and emphasis. The following is a 
  2611. sample of some non-IBM C++ publications that are generally available. This 
  2612. sample is not an exhaustive list. 
  2613.  
  2614.      The Annotated C++ Reference Manual by Margaret A. Ellis and Bjarne 
  2615.       Stroustrup, Addison-Wesley Publishing Company. 
  2616.      C++ Primer by Stanley B. Lippman, Addison-Wesley Publishing Company. 
  2617.      Object-Oriented Design with Applications by Grady Booch, 
  2618.       Benjamin/Cummings. 
  2619.      Object-Oriented Programming Using SOM and DSOM by Christina Lau, Van 
  2620.       Nostrand Reinhold. 
  2621.      OS/2 C++ Class Library: Power GUI Programming with C Set ++ by Kevin 
  2622.       Leong, William Law, Robert Love, Hiroshi Tsuji, and Bruce Olson, Van 
  2623.       Nostrand Reinhold. 
  2624.  
  2625.  Note:  IBM does not specifically recommend any of these books, and other C++ 
  2626.         books may be available in your locality. 
  2627.  
  2628.  
  2629. ΓòÉΓòÉΓòÉ 25. Link my Programs ΓòÉΓòÉΓòÉ
  2630.  
  2631. You can link your programs in four ways: 
  2632.  
  2633.      From within WorkFrame 
  2634.      From the command line 
  2635.      Through the compiler 
  2636.      From a make file 
  2637.  
  2638.  You can link with the following file types: 
  2639.  
  2640.      With .LIB files 
  2641.      With .DLL files 
  2642.  
  2643.  You can link to generate information for: 
  2644.  
  2645.      Debugging 
  2646.      Browsing 
  2647.      Analysis 
  2648.  
  2649.  You can use the linker to create: 
  2650.  
  2651.      An .EXE file 
  2652.      A .DLL file 
  2653.      A device driver 
  2654.      A module definition (.DEF) file 
  2655.      A MAP file 
  2656.  
  2657.  And you can set linker options from within WorkFrame. 
  2658.  
  2659.  Note:  This is not an exhaustive list of tasks used to link your programs. 
  2660.  
  2661.  Related Tasks: 
  2662.  
  2663.      How do I compile and link multithread programs 
  2664.  
  2665.  Related Information: 
  2666.  
  2667.      The Linking section of the User's Guide 
  2668.  
  2669.  
  2670. ΓòÉΓòÉΓòÉ 25.1. Linking from within WorkFrame ΓòÉΓòÉΓòÉ
  2671.  
  2672. In general, you should perform the link action when you build your project 
  2673. target. However, if you want to link individual .OBJ files: 
  2674.  
  2675.    1. Select all the .OBJ files that you want to link together. Note that if 
  2676.       you chose to link multiple files, you must also have a module definition 
  2677.       (.DEF) file defined and selected. 
  2678.    2. Click Mouse Button 2 on the background of the WorkFrame environment, or 
  2679.       select the Selected PullDown menu. 
  2680.    3. Select the Link menu item. 
  2681.  
  2682.  Note that linking is also done as part of the Build process when you build 
  2683.  your project's target. 
  2684.  
  2685.  Related Tasks: 
  2686.  
  2687.      How do I link from the command line 
  2688.      How do I link through the compiler 
  2689.      How do I link from a make file 
  2690.  
  2691.  Related Information: 
  2692.  
  2693.      The WorkFrame How Do I information 
  2694.      The WorkFrame section of the User's Guide 
  2695.  
  2696.  
  2697. ΓòÉΓòÉΓòÉ 25.2. Linking from the command line ΓòÉΓòÉΓòÉ
  2698.  
  2699. The syntax for the ILINK command is: 
  2700.  
  2701.    ILINK [options] filename [directory\] [@responsefile]
  2702.  
  2703. Specify the ILINK command followed by any sequence of options, file names, or 
  2704. directories, separated by space or tab characters. Note that you must specify 
  2705. at least one object file. The directories you specify become part of the 
  2706. linker's search path, before any directories set in the LIB environment 
  2707. variable. You can specify a definition file to describe the characteristics of 
  2708. an application or library, including imports and exports. If you are using a 
  2709. response file, then it should always be specified last. Leave any other 
  2710. parameter blank to accept the default entry for it. You can end the command 
  2711. line at any point with a semicolon (;), to accept the default for all remaining 
  2712. parameters. 
  2713.  
  2714. Note:  If ILINK cannot find a file, it stops linking. The linker does not 
  2715.        assume the .OBJ extension for a file: if you specifya file with no 
  2716.        extension, then the linker looks for that file with no extension. 
  2717.  
  2718.  Related Tasks: 
  2719.  
  2720.      How do I respond to ILINK prompts 
  2721.      How do I link from WorkFrame 
  2722.      How do I link through the compiler 
  2723.      How do I link from a make file 
  2724.  
  2725.  
  2726. ΓòÉΓòÉΓòÉ <hidden> Responding to ILINK prompts ΓòÉΓòÉΓòÉ
  2727.  
  2728. To have the linker prompt you for ILINK entries, specify /NOFREE at the start 
  2729. of the command line (or in the ILINK environment variable), then you can use 
  2730. the LINK386-style syntax to specify input to the linker. For each prompt, 
  2731. simply enter the same input that you would enter on the command line, and press 
  2732. Enter. These are the ILINK prompts: 
  2733.  
  2734.  Object Modules [.obj]:
  2735.  Run File [basename.*]:
  2736.  List File [targetname.map]:
  2737.  Libraries [.LIB]:
  2738.  Definitions File [nul.def]:
  2739.  
  2740. basename defaults to the name of the first object file you specify. targetname 
  2741. defaults to the name of the run file. The prompt displays the default response 
  2742. in square brackets ([ ]). Press Enter to accept the default response to a 
  2743. prompt and continue to the next prompt. To accept default responses for all 
  2744. remaining prompts, enter a semicolon (;). Note that: 
  2745.  
  2746.      To extend input to a new line, type a plus sign (+) as the last character 
  2747.       on the current line. When the same prompt appears on a new line, you can 
  2748.       continue. You cannot split a file name across lines. 
  2749.      You must enter at least one object file. 
  2750.      You can specify options anywhere on any response line. Each option must 
  2751.       begin with a forward slash (/), or a dash (-). 
  2752.      At any prompt, you can specify responses both for that prompt and for 
  2753.       subsequent prompts, by separating the responses with commas (,). 
  2754.  
  2755.  
  2756. ΓòÉΓòÉΓòÉ <hidden> Linking using response files ΓòÉΓòÉΓòÉ
  2757.  
  2758. Instead of specifying linker input on the command line, you can put options and 
  2759. file name parameters in a response file. You can combine the response file with 
  2760. options and parameters on the command line, but the command line options and 
  2761. parameters must appear before the response file; the linker ignores anything on 
  2762. the command line after the response file. 
  2763.  
  2764. In the response file, separate responses with commas, or put each response on a 
  2765. separate line. Then, when you invoke ILINK, use the following syntax: 
  2766.  
  2767.  ILINK @responsefile
  2768.  
  2769. where responsefile is the name of the response file. 
  2770.  
  2771. The @ symbol indicates that the file is a response file. If the file is not in 
  2772. the working directory, specify the path for the file as well as the file name. 
  2773. If ILINK cannot find a file, it stops linking. 
  2774.  
  2775. If the file does not contain responses for all the prompts and does not end in 
  2776. a semicolon (;), then ILINK displays the appropriate prompt and waits for you 
  2777. to supply a response. You must provide the file name for at least one object 
  2778. file. 
  2779.  
  2780. You can use special characters in the response file the same way you would use 
  2781. them in responses entered at the keyboard. For example, you can extend input to 
  2782. a new line by using the plus sign (+) and choose default responses for all 
  2783. remaining prompts by using a semicolon (;). 
  2784.  
  2785.  
  2786. ΓòÉΓòÉΓòÉ 25.3. Linking through the compiler ΓòÉΓòÉΓòÉ
  2787.  
  2788. When you invoke the VisualAge C++ compiler (using the icc command), it compiles 
  2789. the object files from your source code and then automatically starts the 
  2790. linker, to link the object files into an .EXE or .DLL file. Use the /B compiler 
  2791. option to pass options to the linker. By default, the compiler invokes the 
  2792. linker with the following options: 
  2793.  
  2794.  /NOFREEFORMAT Use the LINK386-compatible syntax, instead of the free-format 
  2795.       syntax. for more information on the free-format syntax. for more 
  2796.       information on the LINK386-compatible syntax. 
  2797.  
  2798.  /BASE:65536 Specify the starting address of the program. For .DLL files, this 
  2799.       results in a smaller and potentially faster executable, if the specified 
  2800.       address is free when the .DLL is loaded. For .EXE files, the OS/2 
  2801.       operating system always loads executable programs at 64K. You can give 
  2802.       the linker the address 65536 (or 0x10000) to let the linker know where 
  2803.       the program will be loaded, so it can resolve relocation information at 
  2804.       link time, resulting in a smaller .EXE file. 
  2805.  
  2806.  /PMTYPE:VIO Create program that is compatible with Presentation Manager. 
  2807.  
  2808.  In addition, some compiler options generate equivalent linker options: 
  2809.  
  2810.  /Fb  Generate browser information. Passes /BROWSE to the linker. 
  2811.  
  2812.  /Fm  Generate linker map file. Passes /MAP to the linker. 
  2813.  
  2814.  /Gk  Resolve template functions in old object files. Passes /OLDCPP to the 
  2815.       linker. 
  2816.  
  2817.  /Gl  Remove unreferenced functions. Passes /OPTFUNC to the linker. 
  2818.  
  2819.  /Gn  Hide default library information from the linker. Passes 
  2820.       /NODEFAULTLIBRARYSEARCH to the linker. 
  2821.  
  2822.  /Q   Suppress product information at start of compile. Passes /NOLOGO to the 
  2823.       linker. 
  2824.  
  2825.  /Ti  Generate debugger information. Passes /DEBUG to the linker. 
  2826.  
  2827.  Related Tasks: 
  2828.  
  2829.      How do I link from WorkFrame 
  2830.      How do I link from the command line 
  2831.      How do I link from a make file 
  2832.  
  2833.  Related Information: 
  2834.  
  2835.      The Setting Compiler Options section of the User's Guide 
  2836.      The Linker Options section of the User's Guide 
  2837.  
  2838.  
  2839. ΓòÉΓòÉΓòÉ 25.4. Linking from a make file ΓòÉΓòÉΓòÉ
  2840.  
  2841. Use a make file to organize the sequence of actions (such as compiling and 
  2842. linking) required to build your source. You can then invoke all the actions in 
  2843. one step: 
  2844.  
  2845.    NMAKE makefile_name
  2846.  
  2847. The NMAKE utility saves you time for it will only perform actions on those 
  2848. files that have changed, and on the files that incorporate or depend on the 
  2849. changed files: 
  2850.  
  2851. You can write your own make file, or you can use the WorkFrame MakeMake utility 
  2852. to write the make file for you. 
  2853.  
  2854. Related Tasks: 
  2855.  
  2856.      How do I create make file and dependency files 
  2857.      How do I link from WorkFrame 
  2858.      How do I link from the command line 
  2859.      How do I link through the compiler 
  2860.  
  2861.  
  2862. ΓòÉΓòÉΓòÉ 25.5. Linking with .LIB files ΓòÉΓòÉΓòÉ
  2863.  
  2864. The linker uses library (.LIB) files to resolve external references from code 
  2865. in the object (.OBJ) files. When the linker finds a function or data reference 
  2866. in a .OBJ file that requires a module from a library, the linker links the 
  2867. module from the library to the output file. 
  2868.  
  2869. The compiler embeds the names of needed libraries (called default libraries) in 
  2870. object files. You do not need to specify these libraries: the linker searches 
  2871. them automatically. 
  2872.  
  2873. Specify library files only when: 
  2874.  
  2875.      You want to use libraries other than the default libraries. Libraries you 
  2876.       specify are searched ahead of the default libraries. 
  2877.      You want to specify the default library with its full path, because the 
  2878.       default library is not in the current directory, and not in a directory 
  2879.       specified in the LIB environment variable. You can also specify a path to 
  2880.       a directory, without specifying a file name, to have the linker search 
  2881.       that directory before the directories in the LIB environment variable. 
  2882.  
  2883.  To ignore the default libraries, use the /NODEFAULTLIBRARYSEARCH option. Use 
  2884.  the option with care, because most compilers expect their object files to be 
  2885.  linked with default libraries. 
  2886.  
  2887.  If you want to include all of a library's objects in the output file, instead 
  2888.  of only the required ones, you must link with the /NOFREE option, to use the 
  2889.  LINK386-compatible syntax. You can then enter the library name as an object 
  2890.  file. 
  2891.  
  2892.  Related Tasks: 
  2893.  
  2894.      How do I work with libraries 
  2895.      How do I link from WorkFrame 
  2896.      How do I link from the command line 
  2897.      How do I link through the compiler 
  2898.      How do I link from a make file 
  2899.  
  2900.  Related Information: 
  2901.  
  2902.      The Linking section in the User's Guide 
  2903.  
  2904.  
  2905. ΓòÉΓòÉΓòÉ 25.6. Linking with .DLL files ΓòÉΓòÉΓòÉ
  2906.  
  2907. A dynamic link library (DLL) file contains executable code for common 
  2908. functions, just as an ordinary library (.LIB) file does. However, when you link 
  2909. with a DLL, the code in the DLL is not copied into the executable (.EXE) file. 
  2910. Instead, only the import definitions for DLL functions are copied. At run time, 
  2911. the dynamic link library that contains the functions is loaded into memory, 
  2912. along with the .EXE file that references them. 
  2913.  
  2914. There are two ways to link with a DLL: 
  2915.  
  2916.      Using a .DEF file to define functions your object files import from the 
  2917.       DLL. 
  2918.      Using an import library, created with the IMPLIB utility, that allows the 
  2919.       linker to determine which functions your object files need to import from 
  2920.       the DLL. 
  2921.  
  2922.  Related Tasks: 
  2923.  
  2924.      How do I work with DLLs 
  2925.      How do I link from WorkFrame 
  2926.      How do I link from the command line 
  2927.      How do I link through the compiler 
  2928.      How do I link from a make file 
  2929.  
  2930.  Related Information: 
  2931.  
  2932.      The Linking section in the User's Guide 
  2933.  
  2934.  
  2935. ΓòÉΓòÉΓòÉ 25.7. Linking for debugging ΓòÉΓòÉΓòÉ
  2936.  
  2937. To link your files in order to generate debug information which will allow you 
  2938. to debug the file with the Debugger: 
  2939.  
  2940.    1. Compile with the /Ti option. 
  2941.    2. Link with the /DEBUG option. 
  2942.  
  2943.  When you specify /DEBUG, /BROWSE is turned on by default. 
  2944.  
  2945.  Note:  Linking with /DEBUG increases the size of the executable output file. 
  2946.  
  2947.  Related Tasks: 
  2948.  
  2949.      How do I debug my programs 
  2950.      How do I debug my heap 
  2951.      How do I link from WorkFrame 
  2952.      How do I link from the command line 
  2953.      How do I link through the compiler 
  2954.      How do I link from a make file 
  2955.  
  2956.  Related Information: 
  2957.  
  2958.      The Linking section in the User's Guide 
  2959.      The Debugging section of the User's Guide 
  2960.      The Debugger How Do I... information 
  2961.  
  2962.  
  2963. ΓòÉΓòÉΓòÉ 25.8. Linking for browsing ΓòÉΓòÉΓòÉ
  2964.  
  2965. First, compile with the /Fb compiler option, then link your files with the 
  2966. /BROWSE to add browse information to the load module ILINK generates. The 
  2967. browse information is used by the Browser to allow you to view your program's 
  2968. class structure and component relationships. 
  2969.  
  2970. Note:  The /BROWSE option is automatically turned on when you specify /DEBUG. 
  2971.  
  2972.  Related Tasks: 
  2973.  
  2974.      How do I browse my files 
  2975.      How do I link from WorkFrame 
  2976.      How do I link from the command line 
  2977.      How do I link through the compiler 
  2978.      How do I link from a make file 
  2979.  
  2980.  Related Information: 
  2981.  
  2982.      The Linking section of the User's Guide 
  2983.      The Browser How Do I... information 
  2984.      The Browser section of the User's Guide 
  2985.  
  2986.  
  2987. ΓòÉΓòÉΓòÉ 25.9. Linking for analysis ΓòÉΓòÉΓòÉ
  2988.  
  2989. To include debug information in the executable that allows you to analyze its 
  2990. performance: 
  2991.  
  2992.    1. Compile with the /Ti and /Gh options. 
  2993.    2. Link with the /DEBUG linker option. 
  2994.  
  2995.  ILINK will embed symbolic data and line number information in the output file. 
  2996.  Note that when you specify the /DEBUG linker option, the /BROWSE linker option 
  2997.  is turned on by default. 
  2998.  
  2999.  Note:  Linking with /DEBUG increases the size of the executable output file. 
  3000.  
  3001.  Related Tasks: 
  3002.  
  3003.      How do I analyze performance 
  3004.      How do I link from WorkFrame 
  3005.      How do I link from the command line 
  3006.      How do I link through the compiler 
  3007.      How do I link from a make file 
  3008.  
  3009.  Related Information: 
  3010.  
  3011.      The Linking section in the User's Guide 
  3012.      The Performance Analyzer How Do I... information 
  3013.      The Performance Analyzer section of the User's Guide 
  3014.  
  3015.  
  3016. ΓòÉΓòÉΓòÉ 25.10. Creating an .EXE file ΓòÉΓòÉΓòÉ
  3017.  
  3018. ILINK produces .EXE files by default. 
  3019.  
  3020. To reduce the size of the .EXE file and improve its performance, use the 
  3021. following options: 
  3022.  
  3023.      /ALIGNMENT:value to set the alignment factor in the output file. Set 
  3024.       value to smaller factors to reduce the size of the executable, and to 
  3025.       larger factors to reduce load time for the executable. By default, the 
  3026.       alignment is set to 512. 
  3027.      /EXEPACK to compress the file. 
  3028.  
  3029.  Note:  Set /EXEPACK:2 for executables that will run only on OS/2 v3.0 and 
  3030.         later. 
  3031.  
  3032.  Do not set a value for /BASE; the load address for the executable is always 
  3033.  0x00010000. Any other value will produce a warning, and will not be used. 
  3034.  
  3035.  If you do not specify an extension for the output file name, ILINK 
  3036.  automatically adds the extension .EXE to the name you provide. If you do not 
  3037.  specify an output file name at all, ILINK generates an .EXE file with the same 
  3038.  file name as the first .OBJ file it linked. 
  3039.  
  3040.  If you are using a module definition (.DEF) file, you can include a NAME 
  3041.  statement to provide a name for the application. The .DEF file should not 
  3042.  contain a LIBRARY, VIRTUAL DEVICE, or PHYSICAL DEVICE statement. 
  3043.  
  3044.  Related Tasks: 
  3045.  
  3046.      How do I link from WorkFrame 
  3047.      How do I link from the command line 
  3048.      How do I link through the compiler 
  3049.      How do I link from a make file 
  3050.  
  3051.  Related Information: 
  3052.  
  3053.      The Linking section of the User's Guide 
  3054.  
  3055.  
  3056. ΓòÉΓòÉΓòÉ 25.11. Creating a .DLL file ΓòÉΓòÉΓòÉ
  3057.  
  3058. To produce a DLL as output, compile the object files with the /Ge- compiler 
  3059. option, and specify the LIBRARY statement in your module definition (.DEF) 
  3060. file. 
  3061.  
  3062. To reduce the size of the DLL and improve its performance, use the following 
  3063. options: 
  3064.  
  3065.      /ALIGNMENT:value to set the alignment factor in the output file. Set 
  3066.       value to smaller factors to reduce the size of the DLL, and to larger 
  3067.       factors to reduce load time for the DLL. By default, the alignment is set 
  3068.       to 512. 
  3069.      /EXEPACK to compress the file. 
  3070.  
  3071.  Note:  Set /EXEPACK:2 for DLLs that will run only on OS/2 v3.0 and later. 
  3072.  
  3073.  If you use the /BASE option, set /BASE:0x12000000 (or a lesser value), and 
  3074.  provide a separate value for each DLL. For DLLs, setting a /BASE value can 
  3075.  save load time when the given load address is available. If the load address 
  3076.  is not available, the /BASE value is ignored, and there is no load time 
  3077.  benefit. 
  3078.  
  3079.  Use the _Export keyword, or the EXPORTS statement in a module definition file, 
  3080.  to specify which functions you want to make available to other executables. 
  3081.  
  3082.  Once you have produced the DLL, you can produce an executable that links to 
  3083.  the DLL. This process can be done in two ways: 
  3084.  
  3085.      Using a .DEF file. Provide a .DEF file when you create the executable. In 
  3086.       the .DEF file, use the IMPORTS statement to specify which of the DLL's 
  3087.       functions your object files need. 
  3088.      Using an import library. Use the IMPLIB utility to create an import 
  3089.       library. When you use an import library, you no longer need to use the 
  3090.       IMPORTS statement. ILINK determines which functions your object files 
  3091.       need during the linking process. 
  3092.  
  3093.  Related Tasks: 
  3094.  
  3095.      How do I link from WorkFrame 
  3096.      How do I link from the command line 
  3097.      How do I link through the compiler 
  3098.      How do I link from a make file 
  3099.  
  3100.  Related Information: 
  3101.  
  3102.      The Linking section of the User's Guide 
  3103.  
  3104.  
  3105. ΓòÉΓòÉΓòÉ 25.12. Creating a device driver ΓòÉΓòÉΓòÉ
  3106.  
  3107. You can produce both physical device drivers and virtual device drivers: 
  3108.  
  3109.      A physical device driver (.SYS) allows the operating system to interact 
  3110.       with a system peripheral, such as a monitor or printer. 
  3111.      A virtual device driver (.SYS or .VDD) allows the operating system to 
  3112.       handle input and output with multiple DOS or WIN-OS/2 sessions. Each 
  3113.       session can then act as if it has complete control of the input or output 
  3114.       device, while actually sharing the control with other sessions. 
  3115.  
  3116.  To produce a device driver file (.DRV or .VDD) as output, specify the PHYSICAL 
  3117.  DEVICE or VIRTUAL DEVICE statement in your module definition (.DEF) file. 
  3118.  
  3119.  If you are creating a physical device driver, use the SEGMENTS statement to 
  3120.  specify which segments have I/O privilege. 
  3121.  
  3122.  If you are creating a virtual device driver, compile with the options /Gr+ and 
  3123.  Rn+, and use the subsystem libraries. 
  3124.  
  3125.  Related Tasks: 
  3126.  
  3127.      How do I link from WorkFrame 
  3128.      How do I link from the command line 
  3129.      How do I link through the compiler 
  3130.      How do I link from a make file 
  3131.  
  3132.  Related Information: 
  3133.  
  3134.      The Linking section of the User's Guide 
  3135.  
  3136.  
  3137. ΓòÉΓòÉΓòÉ 25.13. Creating a module definition file ΓòÉΓòÉΓòÉ
  3138.  
  3139. A module definition (.DEF) file contains one or more module statements. These 
  3140. statements: 
  3141.  
  3142.      Define various attributes of your executable output file 
  3143.      Define attributes of code and data segments in the file 
  3144.      Identify data and functions that are imported into or exported from your 
  3145.       file 
  3146.  
  3147.  When you create a module definition file, follow these rules: 
  3148.  
  3149.      Use a NAME, LIBRARY, VIRTUAL DEVICE, or PHYSICAL DEVICE statement to 
  3150.       define the type of executable output you want. You can only use one of 
  3151.       these statements, and it must precede all other statements in the .DEF 
  3152.       file. 
  3153.      Begin comment lines with a semicolon (;). 
  3154.      Enter all module definition keywords in UPPERCASE letters. 
  3155.      Do not use module definition keywords, or reserved words, as a text 
  3156.       parameter to a statement. 
  3157.  
  3158.  Related Tasks: 
  3159.  
  3160.      How do I link from WorkFrame 
  3161.      How do I link from the command line 
  3162.      How do I link through the compiler 
  3163.      How do I link from a make file 
  3164.  
  3165.  Related Information: 
  3166.  
  3167.      The Linking section of the User's Guide 
  3168.      Creating Module Definition Files of the User's Guide 
  3169.  
  3170.  
  3171. ΓòÉΓòÉΓòÉ 25.14. Generating a MAP file ΓòÉΓòÉΓòÉ
  3172.  
  3173. Specify /MAP to generate a map file, which lists the object modules in your 
  3174. output file; segment names, addresses, and sizes; and symbol information. If 
  3175. you do not specify a name for the map file, the map file takes the name of the 
  3176. executable output file, with the extension .map. 
  3177.  
  3178. To prevent the map file from being generated, specify the /NOMAP option. 
  3179.  
  3180. Specify /LINENUMBERS to include source file line numbers and associated 
  3181. addresses in the map file. 
  3182.  
  3183. Related Information: 
  3184.  
  3185.      The Linking section in the User's Guide 
  3186.  
  3187.  
  3188. ΓòÉΓòÉΓòÉ 25.15. Setting linker options using WorkFrame ΓòÉΓòÉΓòÉ
  3189.  
  3190.  
  3191. ΓòÉΓòÉΓòÉ 26. Migrate Files ΓòÉΓòÉΓòÉ
  3192.  
  3193. With VisualAge C++, you can migrate the following: 
  3194.  
  3195.      Headers from 16-bit to 32-bit C or C++ 
  3196.      Headers from 32-bit C Set/2 to 32-bit VisualAge C++ 
  3197.      Old WorkFrame projects 
  3198.  
  3199.  Note:  Note that this is not an exhaustive list. 
  3200.  
  3201.  
  3202. ΓòÉΓòÉΓòÉ 26.1. Migrating headers from 16-bit to 32-bit C or C++ ΓòÉΓòÉΓòÉ
  3203.  
  3204. The following section describes the changes you need to make to existing 16-bit 
  3205. C headers for them to work with both 32-bit C and C++ code. 
  3206.  
  3207. Structures 
  3208.  
  3209.    1. Add #pragma pack statements around declarations of structures that will 
  3210.       be passed to or from 16-bit code. Do not use the _Packed keyword because 
  3211.       it is not supported by C++. 
  3212.    2. Declare integers in the structures as short or long, not int, so that the 
  3213.       structures have the same size and layout in both 16-bit and 32-bit code. 
  3214.    3. Create typedefs for your structures, and use #pragma seg16 on those 
  3215.       typedefs to specify that those structures should not cross a 64K boundary 
  3216.       when laid out in memory. 
  3217.    4. Any structure members that are pointers must be qualified with the _Seg16 
  3218.       type qualifier. For example, far * would be translated to * _Seg16. This 
  3219.       may even need to be done recursively if the 16-bit code will be 
  3220.       manipulating the object pointed at. 
  3221.  
  3222.  Function Prototypes 
  3223.  
  3224.    1. Prototype your functions using the linkage convention keywords. Do not 
  3225.       use #pragma linkage because it is not supported in C++. 
  3226.    2. When you use a function pointer as an argument to a second function, 
  3227.       specify the linkage of the function pointed at in the second function's 
  3228.       prototype. This avoids errors when the /Mp or /Ms compiler options are 
  3229.       used to set the default linkage. 
  3230.    3. If you pass a pointer to a 16-bit function as a member of an aggregate, 
  3231.       array, or class, you must qualify the pointer with _Seg16. The _Seg16 
  3232.       keyword is also required if you use two or more levels of indirection 
  3233.       (for example, a pointer to a pointer). If you pass the pointer directly 
  3234.       as a parameter, the compiler automatically converts it to a 16-bit 
  3235.       pointer and the _Seg16 keyword is not required. 
  3236.  
  3237.  Required Conditional Compilation Directives 
  3238.  
  3239.  The following directives must be added to the beginning of each header file: 
  3240.  
  3241.      #if __cplusplus
  3242.      extern "C" {
  3243.      #endif
  3244.  
  3245.  The following directives must be added to the end of each header file: 
  3246.  
  3247.      #if __cplusplus
  3248.      }
  3249.      #endif
  3250.  
  3251.  
  3252. ΓòÉΓòÉΓòÉ 26.2. Migrating headers from 32-bit C Set/2 to 32-bit VisualAge C++ ΓòÉΓòÉΓòÉ
  3253.  
  3254. You need to make the following changes to your existing header files for them 
  3255. to work with both C and C++ code: 
  3256.  
  3257.    1. Remove any use of the _Packed keyword, and replace it with the 
  3258.       appropriate use of #pragma pack. C++ does not support _Packed. 
  3259.    2. Remove any use of #pragma linkage and add the appropriate linkage 
  3260.       convention keyword to the prototype. C++ does not support #pragma linkage 
  3261.       directives. 
  3262.  
  3263.  In addition, add the following to the beginning of each header file: 
  3264.  
  3265.      #if __cplusplus
  3266.      extern "C" {
  3267.      #endif
  3268.  
  3269.  And, add the following to the end of each header file: 
  3270.  
  3271.      #if __cplusplus
  3272.      }
  3273.      #endif
  3274.  
  3275.  
  3276. ΓòÉΓòÉΓòÉ 26.3. Migrating old WorkFrame projects ΓòÉΓòÉΓòÉ
  3277.  
  3278.  
  3279. ΓòÉΓòÉΓòÉ 27. Optimize for Speed and Size ΓòÉΓòÉΓòÉ
  3280.  
  3281.  
  3282. ΓòÉΓòÉΓòÉ 28. Set Runtime Environment Variables    ΓòÉΓòÉΓòÉ
  3283.  
  3284. There are two kinds of "runtimes" for which variables can be set: 
  3285.  
  3286.      The runtime in which the compiler and tools run (when you edit, build and 
  3287.       debug the your application). 
  3288.      The runtime in which the resulting (built) application runs. 
  3289.  
  3290.  Note:  You need to be aware of both runtimes. 
  3291.  
  3292.      In the first case for the compiler and tools to perform successfully 
  3293.       together, and 
  3294.      In the second case to ensure your application does not behave in an 
  3295.       unexpected manner. 
  3296.  
  3297.  
  3298. ΓòÉΓòÉΓòÉ 28.1. For the compiler and tools ΓòÉΓòÉΓòÉ
  3299.  
  3300. The VisualAge C++ compiler checks the OS/2 environment variables for path 
  3301. information and for the default values of compiler options. 
  3302.  
  3303.      If the VisualAge C++ installation program updated your config.sys file, 
  3304.       many of the environment variables already have values for the compiler to 
  3305.       use. The following OS/2 environment variables affect the operation of the 
  3306.       VisualAge C++ compiler during compilation: DPATH, ICC, ILINK, INCLUDE, 
  3307.       LIBD, PATH, and TMP. Note that if you did not have VisualAge C++ update 
  3308.       your config.sys file, a file called config.add is created, and you can 
  3309.       mirror these changes in your config.sys file. 
  3310.      If the program did not update config.sys, you can set these values by 
  3311.       running the csetenv.cmd file in your OS/2 session before using the 
  3312.       compiler. Note that if you double-click on the C/C++ Window icon in the 
  3313.       VisualAge C++ desktop folder, then this command file is automatically 
  3314.       run. 
  3315.  
  3316.  Some environment variables, for example ICC, are optional. They are not added 
  3317.  to your config.sys, file or to csetenv.cmd for you. 
  3318.  
  3319.  If you chose not to modify your config.sys file at the time you installed 
  3320.  VisualAge C++, the LIBPATH statement, the DEVICE statement, and numerous other 
  3321.  environment variables required for one or more components to work properly, 
  3322.  will not be set correctly in your config.sys file. Instead, the necessary 
  3323.  updates were placed in a file called config.add. You can modify your 
  3324.  config.sys file after install by mirroring the updates in the config.add. 
  3325.  
  3326.  
  3327. ΓòÉΓòÉΓòÉ 28.2. For the application that you have Built ΓòÉΓòÉΓòÉ
  3328.  
  3329. You need to be aware of the following variables in your application's runtime, 
  3330. for they can affect the behaviour of your application and lead to unexpected 
  3331. results if not taken into account. 
  3332.  
  3333.      PATH 
  3334.      LOCPATH 
  3335.      LC Environment Variables 
  3336.      DPATH 
  3337.      LIBPATH 
  3338.      TMP 
  3339.      TEMPMEM 
  3340.      COMSPEC 
  3341.      TZ 
  3342.  
  3343.  Most of these variables can be set: 
  3344.  
  3345.      from the command line, 
  3346.      in your CONFIG.SYS file, 
  3347.      in a command file using the SET command, or 
  3348.      from within your program using the putenv function. 
  3349.  
  3350.  You can put an optional semicolon at the end of the commands that set the 
  3351.  environment variables so that you can later append values to the variables 
  3352.  from the command line. 
  3353.  
  3354.  The functions that access these environment variables are not available when 
  3355.  you use the subsystem libraries. To access the environment variables when 
  3356.  using the subsystem libraries, you must use OS/2 APIs. 
  3357.  
  3358.  Related Tasks: 
  3359.  
  3360.      How do I change my config.sys file for VisualAge C++ 
  3361.  
  3362.  Related Information: 
  3363.  
  3364.      The PM Programming Reference for more information about OS/2 APIs. 
  3365.      The OS/2 Command Reference. 
  3366.      For more information on environment variables in general, see the OS/2 
  3367.       Master Help Index. 
  3368.  
  3369.  
  3370. ΓòÉΓòÉΓòÉ 29. Specify whether I want an EXE or DLL ΓòÉΓòÉΓòÉ
  3371.  
  3372. Use the /Ge- compiler option to create DLLs and the /Ge+ compiler option to 
  3373. create EXEs. 
  3374.  
  3375. The /Ge- option causes the compiler to generates a reference to _dllentry for 
  3376. every module compiled. The /Ge+ option genereates a reference to _exeentry only 
  3377. if a main function is found in the source. If no main function is included, no 
  3378. linking reference is generated. 
  3379.  
  3380. If you want to create a library of objects that can be linked into either an 
  3381. executable file or a DLL, use the /Ge+ option when you compile. 
  3382.  
  3383. Typically, these objects do not contain a reference to main. If they do, you 
  3384. can override the /Ge option when you link your files. See the Programming Guide 
  3385. for information on how to override the /Ge option. 
  3386.  
  3387. Related Tasks: 
  3388.  
  3389.      How do I set compiler options using WorkFrame 
  3390.      How do I compile my programs 
  3391.  
  3392.  
  3393. ΓòÉΓòÉΓòÉ 30. Trace my Programs ΓòÉΓòÉΓòÉ
  3394.  
  3395.  
  3396. ΓòÉΓòÉΓòÉ 31. Understand my Program's Class Hierarchy ΓòÉΓòÉΓòÉ
  3397.  
  3398. Use the VisualAge C++ Browser to help you understand a program's class 
  3399. hierarchy structure. With the Browser, you can: 
  3400.  
  3401.      View a class hierarchy 
  3402.      View include file graphs 
  3403.      View members of a class 
  3404.      List implementing files 
  3405.      List objects defined in a file 
  3406.  
  3407.  Related Tasks: 
  3408.  
  3409.      How do I browse my programs 
  3410.      How do I determine what classes are in the VisualAge C++ Open Class 
  3411.       Library 
  3412.  
  3413.  Related Information: 
  3414.  
  3415.      The Browser How Do I... information 
  3416.      The Browser section of the User's Guide 
  3417.  
  3418.  
  3419. ΓòÉΓòÉΓòÉ 32. Use Templates ΓòÉΓòÉΓòÉ
  3420.  
  3421. The recommended way to instantiate templates is to structure your program for 
  3422. their automatic instantiation. 
  3423.  
  3424. To use this facility: 
  3425.  
  3426.    1. Declare your template functions in a header file using class or function 
  3427.       templates, but do not define them. Include the header file in your source 
  3428.       code. 
  3429.    2. For each header file, create a template-implementation file with the same 
  3430.       name as the header and the extension .c. Define the template functions in 
  3431.       this template-implementation file. 
  3432.       The function definitions in your template-implementation file can be 
  3433.       explicit definitions, template definitions, or both. Any explicit 
  3434.       definitions are used instead of the definitions generated by the 
  3435.       template. 
  3436.    3. If you have other declarations that are used inside templates but are not 
  3437.       template parameters, you must place or #include them in either the 
  3438.       template-implementation file or one of the header files that will be 
  3439.       included as a result of the above three steps. 
  3440.       Define any classes that are used in template arguments and that are 
  3441.       required to generate the template function in the header file. If the 
  3442.       class definitions require other header files, include them with the 
  3443.       #include directive. The class definitions are then available in the 
  3444.       template-implementation file when the function definition is compiled. Do 
  3445.       not put the definitions of any classes used in template arguments in your 
  3446.       source code. 
  3447.       For each header file with template functions that need to be defined, the 
  3448.       compiler generates a template-include file. The template-include file 
  3449.       generates #include statements in that file for: 
  3450.           The header file with the template declaration 
  3451.           The corresponding template-implementation file 
  3452.           Any other header files that declare types used in template 
  3453.            parameters. 
  3454.       Before it invokes the linker, the compiler compiles the template-include 
  3455.       files and generates the necessary template function definitions. Only one 
  3456.       definition is generated for each template function. 
  3457.       Use the same compiler options to link your object files that you use to 
  3458.       compile them. For example, if you compile with the command: 
  3459.  
  3460.                icc /C /Gm /Sa myfile.cpp
  3461.  
  3462.       link with the command: 
  3463.  
  3464.                icc /Tdp /Gm /Sa myfile.obj
  3465.  
  3466.       This is especially important for options that control libraries, linkage, 
  3467.       and code compatibility. This does not apply to options that affect only 
  3468.       the creation of object code (for example, /C and /Fo). 
  3469.  
  3470.  Note:  By default, the compiler stores the template-include files in the 
  3471.         TEMPINC subdirectory under the current directory. The compiler creates 
  3472.         the TEMPINC directory if it does not already exist. To redirect the 
  3473.         template-include files to another directory, use the /Ftdir compiler 
  3474.         option, where dir is the directory to contain the template-include 
  3475.         files. You can specify a fully-qualified path name or a path name 
  3476.         relative to the current directory. 
  3477.         If you specify a different directory for your template-include files, 
  3478.         make sure that you specify it consistently for all compilations of your 
  3479.         program, including the link step. 
  3480.  
  3481.  Related Tasks: 
  3482.  
  3483.      How do I compile my programs 
  3484.  
  3485.  Related Information: 
  3486.  
  3487.      The Using Templates section of the Programming Guide 
  3488.      The C++ Templates section of the Language Reference 
  3489.  
  3490.  
  3491. ΓòÉΓòÉΓòÉ 33. Visually Create Program Parts ΓòÉΓòÉΓòÉ
  3492.  
  3493. Visual Builder is a visual programming tool that can help you create 
  3494. object-oriented programs using the C++ programming language. With Visual 
  3495. Builder, you can create applications faster and easier than you ever could 
  3496. using a text editor. Visual Builder provides a powerful visual editor, the 
  3497. Composition Editor, which enables you to create complete applications, often 
  3498. without writing code. 
  3499.  
  3500. You can start Visual Builder in the following ways: 
  3501.  
  3502.      From the C/C++ window 
  3503.      From the Tools folder 
  3504.      From a WorkFrame project environment 
  3505.  
  3506.  Related Information: 
  3507.  
  3508.      The Visual Builder How Do I... information 
  3509.      The Visual Builder User's Guide 
  3510.      The Visual Builder Parts Reference 
  3511.  
  3512.  
  3513. ΓòÉΓòÉΓòÉ <hidden> Starting Visual Builder from the C/C++ Window ΓòÉΓòÉΓòÉ
  3514.  
  3515. To start Visual Builder from the C/C++ window, do the following: 
  3516.  
  3517.    1. Double-click on the icon for the VisualAge C++ desktop folder. 
  3518.    2. Double-click on the C/C++ Window icon. The C/C++ window opens. 
  3519.    3. Type the following: icsvb 
  3520.    4. Press the Enter key. A Visual Builder session is started. 
  3521.  
  3522.  Related Information: 
  3523.  
  3524.      The Visual Builder How Do I... information 
  3525.      The Visual Builder User's Guide 
  3526.      The Visual Builder Parts Reference 
  3527.  
  3528.  
  3529. ΓòÉΓòÉΓòÉ <hidden> Starting Visual Builder from the Tools Folder ΓòÉΓòÉΓòÉ
  3530.  
  3531. To start Visual Builder from the Tools folder, do the following: 
  3532.  
  3533.    1. Double-click on the icon for the VisualAge C++ desktop folder. 
  3534.    2. Double-click on the Tools folder icon. 
  3535.    3. Double-click on the Visual Builder icon. A Visual Builder session is 
  3536.       started. 
  3537.  
  3538.  Related Information: 
  3539.  
  3540.      The Visual Builder How Do I... information 
  3541.      The Visual Builder User's Guide 
  3542.      The Visual Builder Parts Reference 
  3543.  
  3544.  
  3545. ΓòÉΓòÉΓòÉ <hidden> Starting Visual Builder from a WorkFrame Project ΓòÉΓòÉΓòÉ
  3546.  
  3547. You can start Visual Builder from a WorkFrame project environment in the 
  3548. following ways. 
  3549.  
  3550. Note:  The following steps assume that your project inherits the settings of a 
  3551.        WorkFrame project, or that you have changed the Visual action to the 
  3552.        project level. 
  3553.  
  3554.      If the WorkFrame project environment is closed, you can click on the 
  3555.       project icon with Mouse Button 2, and select Visual from the PopUp menu. 
  3556.  
  3557.      If the WorkFrame project environment is open, you can do either of the 
  3558.       following: 
  3559.  
  3560.         -  Double-click on the name of the .VBB file. 
  3561.         -  Click on the name of the .VBB file with Mouse Button 2, and select 
  3562.            Visual from the PopUp menu. 
  3563.         -  Click on the background in the project environment with Mouse Button 
  3564.            2, and select Visual from the PopUp menu. 
  3565.  
  3566.       A Visual Builder session is started. If you used a .VBB file to open 
  3567.       Visual Builder, that file is preloaded. 
  3568.  
  3569.  Related Information: 
  3570.  
  3571.      The Visual Builder How Do I... information 
  3572.      The Visual Builder User's Guide 
  3573.      The Visual Builder Parts Reference 
  3574.  
  3575.  
  3576. ΓòÉΓòÉΓòÉ 34. Work with DLLs ΓòÉΓòÉΓòÉ
  3577.  
  3578. You can do any of the following with runtime libraries (.DLLs): 
  3579.  
  3580.      Share a data segment from multiple DLLs 
  3581.      Export C++ members from a DLL 
  3582.      Ship a VisualAge C++ runtime library 
  3583.      Create your own DLLs 
  3584.      Choose runtime libraries 
  3585.      Link with .DLL files 
  3586.      Handle Signals and OS/2 Exceptions in DLLs 
  3587.  
  3588.  Note:  Note that this is not an exhaustive list. 
  3589.  
  3590.  Related Information: 
  3591.  
  3592.      The Developing Subsystems section of the Programming Guide 
  3593.      The Packaging the VisualAge C++ Runtime DLLs 
  3594.  
  3595.  
  3596. ΓòÉΓòÉΓòÉ 34.1. Sharing a data segment from multiple DLLs ΓòÉΓòÉΓòÉ
  3597.  
  3598. To share a data segment: 
  3599.  
  3600.    1. Use #pragma data_seg to name the data segment you want to share. 
  3601.    2. In the .DEF file for your DLL, specify DATA MULTIPLE NONSHARED. 
  3602.    3. In the .DEF file, add a SEGMENTS statement that specifies that the named 
  3603.       segment is SINGLE SHARED. 
  3604.  
  3605.  Note:  If you need to initialize data structures in the shared segment, you 
  3606.         will need to add this to the DLL initialization routine. Remember that 
  3607.         this routine is run for each instance of your DLL, so you will need to 
  3608.         ensure that your data structures are only initialized once. 
  3609.  
  3610.  Related Information: 
  3611.  
  3612.      The Building DLLs section of the Programming Guide 
  3613.      The Creating Module Definition Files section of the User's Guide 
  3614.  
  3615.  
  3616. ΓòÉΓòÉΓòÉ 34.2. Exporting C++ members from a DLL ΓòÉΓòÉΓòÉ
  3617.  
  3618. To export a member function from a DLL: 
  3619.  
  3620.      Specify the _Export keyword in either the class definition or the 
  3621.       function definition. This keyword is not valid in the function prototype. 
  3622.  
  3623.  For example, to export the function exportme from the class A: 
  3624.  
  3625.      class A {
  3626.         void _Export exportme();
  3627.      };
  3628.  
  3629.      void _Export A::exportme() {
  3630.         return;
  3631.      }
  3632.  
  3633.  
  3634. ΓòÉΓòÉΓòÉ 34.3. Shipping a VisualAge C++ runtime library ΓòÉΓòÉΓòÉ
  3635.  
  3636. If you are shipping your application to other users, you must use one of three 
  3637. methods to make the VisualAge C++ runtime library functions available to the 
  3638. users of your application: 
  3639.  
  3640.    1. Statically bind every module to the library (.LIB) files. This method 
  3641.       increases the size of your modules and also slows the performance because 
  3642.       the library environment has to be initialized for each module. Having 
  3643.       multiple library environments also makes signal handling, file I/O, and 
  3644.       other operations more complicated. 
  3645.  
  3646.    2. Use the DLLRNAME to rename the VisualAge C++ library DLLs. You can then 
  3647.       ship the renamed DLLs with your application. DLLRNAME is described in the 
  3648.       Using the DLLRNAME Utility in the User's Guide. 
  3649.  
  3650.    3. Create your own runtime DLLs. This method provides one common runtime 
  3651.       environment for your entire application. It also lets you apply changes 
  3652.       to the runtime library without relinking your application, meaning that 
  3653.       if the VisualAge C++ DLLs change, you only need to rebuild your own DLL. 
  3654.       In addition, you can tailor your runtime DLL to contain only those 
  3655.       functions you use, including your own. 
  3656.  
  3657.  Note:  DLLRNAME is a utility used to rename DLLs. It also alters the names in 
  3658.         the compiled .EXE and .DLL files that use this renamed DLL. 
  3659.  
  3660.  
  3661. ΓòÉΓòÉΓòÉ 34.4. Creating your own runtime libraries (DLLs) ΓòÉΓòÉΓòÉ
  3662.  
  3663. To create your own runtime library, follow these steps: 
  3664.  
  3665.    1. Copy and rename the appropriate VisualAge C++ .DEF file for the program 
  3666.       you are creating. For example, for a multithread program, copy 
  3667.       cppom30.def to myrtdll.def. You must also change the DLL name on the 
  3668.       LIBRARY line of the .DEF file. The .DEF files are installed in the LIB 
  3669.       subdirectory under the main VisualAge C++ installation directory. 
  3670.  
  3671.    2. Remove any functions that you do not use directly or indirectly (through 
  3672.       other functions) from your .DEF file (myrtdll.def), file, including the 
  3673.       STUB line. Do not delete anything with the comment **** next to it; 
  3674.       variables and functions indicated by this comment are used by startup 
  3675.       functions and are always required. 
  3676.  
  3677.    3. Create a source file for your DLL, for example, myrtdll.c. If you are 
  3678.       creating a runtime library that contains only VisualAge C++ functions, 
  3679.       create an empty source file. If you are adding your own functions to the 
  3680.       library, put the code for them in this file. 
  3681.  
  3682.    4. Compile and link your DLL files. Use the /Ge- option to create a DLL, and 
  3683.       the appropriate option for the type of DLL you are building (/Gm+ for 
  3684.       multithread or /Gm-, the default, for single-thread). For example, to 
  3685.       create a multithread DLL, use the command: 
  3686.  
  3687.                icc /Ge- /Gm+ myrtdll.c myrtdll.def
  3688.  
  3689.    5. Use the IMPLIB utility to create an import library for your DLL. For 
  3690.       example: 
  3691.  
  3692.                implib /NOI myrtdlli.lib myrtdll.def
  3693.  
  3694.    6. Use the ILIB utility to convert the import library. For example: 
  3695.  
  3696.                ilib /CONV /NOE /NOBR myrtdlli.lib
  3697.  
  3698.    7. Use the ILIB utility to add the object modules that contain the 
  3699.       initialization and termination functions to your import library. These 
  3700.       objects are needed by all executable modules and DLLs. They are contained 
  3701.       in cppom30o.lib for multithread programs and cppos30o.lib for 
  3702.       single-thread programs. For information on how to use ILIB, see the 
  3703.       Linking to a DLL Using an Import Library section of the User's Guide. 
  3704.  
  3705.       Note:  If you do not use the ILIB utility, you must ensure that all 
  3706.              objects that access your runtime DLL are statically linked to the 
  3707.              appropriate object library. 
  3708.  
  3709.    8. Compile your executable modules and other DLLs with the /Gn+ option to 
  3710.       exclude the default library information. For example: 
  3711.  
  3712.                icc /C /Gn+ /Ge+ myprog.c
  3713.                icc /C /Gn+ /Ge- mydll.c
  3714.  
  3715.       When you link your objects, specify your own import library. If you are 
  3716.       using or plan to use OS/2 APIs, specify os2386.lib also. For example: 
  3717.  
  3718.                ilink myprog.obj myrtdlli.lib os2386.lib
  3719.                ilink mydll.obj myrtdlli.lib os2386.lib
  3720.  
  3721.       To compile and link in one step, use the commands: 
  3722.  
  3723.                icc /Gn+ /Ge+ myprog.c myrtdlli.lib os2386.lib
  3724.                icc /Gn+ /Ge- mydll.c myrtdlli.lib os2386.lib
  3725.  
  3726.       Note:  If you did not use the ILIB utility to add the initialization and 
  3727.              termination objects to your import library, specify the following 
  3728.              when you link your modules: 
  3729.  
  3730.         a. cppos30o.lib or cppom30o.lib 
  3731.         b. Your import library 
  3732.         c. os2386.lib (to allow you to use OS/2 APIs) 
  3733.         d. The linker option /NOD. 
  3734.  
  3735.       For example: 
  3736.  
  3737.                ilink /NOD myprog.obj cppos30o.lib myrtdlli.lib os2386.lib;
  3738.                ilink /NOD mydll.obj cppos30o.lib myrtdlli.lib os2386.lib;
  3739.  
  3740.       The /NOD option tells the linker to disregard the default libraries 
  3741.       specified in the object files and use only the libraries given on the 
  3742.       command line. If you are using icc to invoke the linker for you, the 
  3743.       commands would be: 
  3744.  
  3745.                icc /B"/NOD" myprog.c cppos30o.lib myrtdlli.lib os2386.lib
  3746.                icc /Ge- /B"/NOD" mydll.c cppos30o.lib myrtdlli.lib os2386.lib
  3747.  
  3748.       The linker then links the objects from the object library directly into 
  3749.       your executable module or DLL. 
  3750.  
  3751.  
  3752. ΓòÉΓòÉΓòÉ 34.5. Choosing runtime libraries ΓòÉΓòÉΓòÉ
  3753.  
  3754. When you compile, the compiler defines default VisualAge C++ runtime libraries 
  3755. for the linker to use. You can use compiler options to control the linking 
  3756. process by changing the type of runtime library you link to. If you do not 
  3757. specify any options, the compiler uses the library that produces single-thread 
  3758. executable modules that are statically linked. You can link to another library 
  3759. by specifying the appropriate options. You would link to another library to: 
  3760.  
  3761.      Dynamically link your program 
  3762.      Create a multithread executable module. 
  3763.      Develop a subsystem. 
  3764.      Create a DLL for use with another executable module. 
  3765.  
  3766.  The naming conventions used for the libraries are intended to help identify 
  3767.  their function: 
  3768.  
  3769.  C/C++ Runtime Libraries 
  3770.  
  3771.      CPPpivvt.DLL
  3772.      CPPpivvt.LIB
  3773.  
  3774.  Where: 
  3775.  
  3776.  p    is the platform specifier 
  3777.        O for OS/2 
  3778.        W for Windows 
  3779.  i    is the library identifier 
  3780.        S for single-threaded 
  3781.        M for multi-threaded 
  3782.        n for no environment 
  3783.  vv   is the version number (major, minor, i.e. 3.0 = 30) 
  3784.  t    is the type 
  3785.        i for import library 
  3786.        o for object library (used for building imports) 
  3787.         blank for standard 
  3788.  
  3789.  Open Class Libraries/Open Class Resource DLLs/Visual Builder Class 
  3790.  Libraries/Data Access Builder Class Libraries/Performance Analyzer 
  3791.  DLL/OBJ/Device Driver 
  3792.  
  3793.      CPPpiivt.DLL
  3794.      CPPpiivt.LIB
  3795.      CPPpiivt.OBJ
  3796.      CPPpiivt.SYS
  3797.  
  3798.  Where: 
  3799.  
  3800.  p    is the platform specifier 
  3801.        O for OS/2 
  3802.        W for Windows 
  3803.  ii   is the library identifier 
  3804.        OB - Open Class Base library (Collection/Application Support) 
  3805.        OC - Open Class (for single import library) 
  3806.        OD - Open Class DDE library 
  3807.        OM - Open Class Multimedia library 
  3808.        OR - Open Class Resource DLLs 
  3809.        OU - Open Class User Interface Base library 
  3810.        OV - Open Class Visual library 
  3811.        OX - Open Class Complex library 
  3812.        OY - Open Class Complex Multithreaded library 
  3813.        Vn - Visual sample library n 
  3814.        DI - Data Access Builder IDL library 
  3815.        DS - Data Access Builder Static SQL library 
  3816.        PA - Performance Analyzer 
  3817.  v    is the version number 
  3818.        3 for IBM VisualAge C++ Version 3 
  3819.  t    is the type 
  3820.        i for import library 
  3821.        o for object library (used for building imports) 
  3822.         blank for standard 
  3823.        U for US English (Resource DLL only) 
  3824.        J for Japanese (Resource DLL only) 
  3825.        K for Korean (Resource DLL only) 
  3826.        T for Taiwanese (Resource DLL only) 
  3827.        P for Simplified Chinese (Resource DLL only) 
  3828.  
  3829.  Data Access Builder Resource DLLs 
  3830.  
  3831.      CPPpSQvt.DLL
  3832.  
  3833.  Where: 
  3834.  
  3835.  p    is the platform specifier 
  3836.        O for OS/2 
  3837.        W for Windows 
  3838.  v    is the version number 
  3839.        3 for IBM VisualAge C++ Version 3 
  3840.  t    is the type 
  3841.        U for US English (Resource DLL only) 
  3842.        J for Japanese (Resource DLL only) 
  3843.        K for Korean (Resource DLL only) 
  3844.        T for Taiwanese (Resource DLL only) 
  3845.        P for Simplified Chinese (Resource DLL only) 
  3846.  
  3847.  
  3848. ΓòÉΓòÉΓòÉ 34.6. Linking with .DLL files ΓòÉΓòÉΓòÉ
  3849.  
  3850.  
  3851. ΓòÉΓòÉΓòÉ 34.7. Handling signals and OS/2 exceptions in DLLs ΓòÉΓòÉΓòÉ
  3852.  
  3853. Handling signals and OS/2 exceptions in DLLs is no different than handling 
  3854. signals in executable files, providing all your DLLs and the executable files 
  3855. that use them are created using the VisualAge C++ compiler, and only one 
  3856. VisualAge C++ library environment exists for your entire application (your 
  3857. executable module and all DLLs). 
  3858.  
  3859. The library environment is a section of information associated with and 
  3860. statically linked to the VisualAge C++ library itself. You can be sure your 
  3861. program has only one library environment if: 
  3862.  
  3863.      It consists of a single executable module. By definition, a single module 
  3864.       has only one copy of the VisualAge C++ library environment regardless of 
  3865.       whether it links to the library statically or dynamically. 
  3866.      Your executable module dynamically links to a single DLL that is 
  3867.       statically bound to the VisualAge C++ runtime library and that uses the 
  3868.       VisualAge C++ library functions. The executable module then accesses the 
  3869.       library functions through the DLL. 
  3870.      Your executable modules and DLLs all dynamically link to the VisualAge 
  3871.       C++ runtime library. 
  3872.  
  3873.  If more than one of your modules is statically linked to the VisualAge C++ 
  3874.  library, your program has more than one library environment. Because there is 
  3875.  no communication between these environments, certain operations and functions 
  3876.  become restricted: 
  3877.  
  3878.      Stream I/O. 
  3879.      Memory allocation. 
  3880.      strtok, rand, and srand functions. 
  3881.      errno and _doserrno values. 
  3882.      Signal and OS/2 exception handlers. 
  3883.  
  3884.  In general, it is easier to use only one library environment, but not always 
  3885.  possible. For example, if you are building a DLL that will be called by a 
  3886.  number of applications, you should assume that there may be multiple library 
  3887.  environments and code your DLL accordingly. 
  3888.  
  3889.  Related Information: 
  3890.  
  3891.      The Signal and OS/2 Exception Handling section of the Programming Guide 
  3892.  
  3893.  
  3894. ΓòÉΓòÉΓòÉ 35. Work with Libraries ΓòÉΓòÉΓòÉ
  3895.  
  3896. The following topics are discussed in this How Do I... information: 
  3897.  
  3898.      Build/Maintain a .LIB 
  3899.      Link with .LIB files 
  3900.      Determine what classes are in the VisualAge C++ Open Class Library 
  3901.  
  3902.  Note:  Note that this is not an exhaustive list. 
  3903.  
  3904.  Related Information: 
  3905.  
  3906.      How do I work with DLLs 
  3907.  
  3908.  
  3909. ΓòÉΓòÉΓòÉ 35.1. Building/Maintaining a .LIB (object library) ΓòÉΓòÉΓòÉ
  3910.  
  3911. To build and maintain libraries of object code, use the ILIB utility. Library 
  3912. files are given the extension .LIB. ILIB works with standard libraries and OS/2 
  3913. import libraries. It does not work with dynamic link libraries (DLLs). 
  3914.  
  3915. Use the ILIB utility to: 
  3916.  
  3917.      Create a new library 
  3918.      Add, delete, or replace modules in a library 
  3919.      Copy object modules in a library to object files 
  3920.      List the contents of a library 
  3921.  
  3922.  Type ILIB at the OS/2 command prompt to start the utility. Parameters can be 
  3923.  supplied by either specifying them directly on the command line, by responding 
  3924.  to the prompts given by ILIB (use the /NOFREE option to get prompts), or by 
  3925.  supplying a response file. The following prompts are given: 
  3926.  
  3927.  Library Name Name of the input library to be modified or created. If the 
  3928.            library you specify does not exist, you will be asked whether to 
  3929.            create a new one. 
  3930.  Operation(s) Commands to modify the library. If no operations are specified, 
  3931.            the input library is unchanged. 
  3932.  List File Name of the listing file to be created. If no listing file is 
  3933.            specified, then no listing file is created. 
  3934.  New Library Name Name of the output library to be created from the input 
  3935.            library. If no output library is specified, the ILIB will modify the 
  3936.            input library. 
  3937.  
  3938.  For more information on using the ILIB utility, see the ILIB Commands section 
  3939.  of the User's Guide. 
  3940.  
  3941.  
  3942. ΓòÉΓòÉΓòÉ 35.2. Linking with .LIB files ΓòÉΓòÉΓòÉ
  3943.  
  3944.  
  3945. ΓòÉΓòÉΓòÉ 35.3. Determining what classes are in the VisualAge C++ Open Class Library ΓòÉΓòÉΓòÉ
  3946.  
  3947.  
  3948. ΓòÉΓòÉΓòÉ <hidden> If You Still Need Help ΓòÉΓòÉΓòÉ
  3949.  
  3950. If you did not find the answer to your question in this information, please try 
  3951. one of the following: 
  3952.  
  3953.      How Do I... information for each component of VisualAge C++: 
  3954.         -  Browser 
  3955.         -  Data Access Builder 
  3956.         -  Debugger 
  3957.         -  Editor 
  3958.         -  Performance Analyzer 
  3959.         -  Visual Builder 
  3960.         -  WorkFrame 
  3961.      Frequently Asked Questions 
  3962.      User's Guide information for conceptual information using the components 
  3963.       of VisualAge C++ and the classes of the VisualAge C++ Open Class Library 
  3964.       for coding in C and C++: 
  3965.         -  Browser 
  3966.         -  Class Library 
  3967.         -  Data Access Builder 
  3968.         -  Debugger 
  3969.         -  Editor 
  3970.         -  Open Class Library 
  3971.         -  Performance Analyzer 
  3972.         -  Visual Builder 
  3973.         -  WorkFrame 
  3974.      Programming Guide 
  3975.      Reference information for coding in C and C++: 
  3976.         -  C Library Reference 
  3977.         -  Editor Command Reference 
  3978.         -  Language Reference 
  3979.         -  Open Class Library Reference 
  3980.         -  Visual Builder Parts Reference 
  3981.  
  3982.  If you still require assistance, see How Do I Get Support. This covers 
  3983.  telephone and electronic support for US, Canada and outside North America. In 
  3984.  addition, it outlines how to acquire your free 60-day getting started period.