home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / VSCPPv8.zip / VACPP / IBMCPP / samples / COMPILER / SAMPLE04 / READ.ME < prev    next >
Text File  |  1995-06-08  |  4KB  |  123 lines

  1.  
  2. SAMPLE04 - 32/16 SAMPLE
  3.  
  4. DESCRIPTION:
  5.  
  6.   This sample program shows how to call 16-bit code from a 32-bit program, and
  7.   also how to call back to a 32-bit function from a 16-bit routine.  The 16-bit
  8.   code is placed in two DLLs, one of which is bound to the 32-bit program at
  9.   load time by using IMPLIB to build an import library.  The other is bound at
  10.   run time using OS/2 APIs.
  11.  
  12.  
  13. TASK:
  14.  
  15.   Prints a short poem.
  16.  
  17.  
  18. FEATURE/CONCEPT:
  19.  
  20.   Calling to and from 16-bit code.
  21.  
  22.  
  23. PROJECT LOCATION:
  24.  
  25.   Inside the COMPILER Sample folder (inside the VisualAge C++ for 
  26.   OS/2 SAMPLES folder).
  27.  
  28. SOURCE FILE LOCATION:
  29.  
  30.   X:\IBMCPP\SAMPLES\COMPILER\SAMPLE04 
  31.  
  32.   where X: is the drive you installed the samples and document component
  33.   of VisualAge C++ for OS/2.
  34.  
  35. HOW TO RUN THE SAMPLE:
  36.     
  37. - FROM WITHIN THE WorkFrame ENVIRONMENT  
  38.   Open the Samples folder on your OS/2 desktop then double-click 
  39.   on the project's icon to open the project view of the sample.  
  40.   From the project menubar, select MONITOR then SHOW.  Now click on the 
  41.   RUN button on the project's toolbar.        
  42.  
  43. - FROM THE COMMAND LINE
  44.    Simply type the name of the .EXE file, that is:
  45.     
  46.    SAMPLE04
  47.  
  48. HOW TO BUILD THE SAMPLE PROJECT YOURSELF:
  49.     
  50. - FROM WITHIN THE WorkFrame ENVIRONMENT
  51.    Open the Samples folder on your OS/2 desktop then double-click on the 
  52.    project's icon to open the project view of the sample. In the upper half 
  53.    of the project window you will see the icons of the files associated with 
  54.    the sample.  From the Project pulldown, select BUILD -> REBUILD ALL. To 
  55.    run the sample project, see HOW TO RUN THE SAMPLE above.
  56.  
  57. - FROM THE COMMAND LINE
  58.    A command file is provided to allow rebuilding of the WorkFrame projects 
  59.    from the command line.  Simply type:
  60.  
  61.    BUILD
  62.  
  63.    To run the sample project, see HOW TO RUN THE SAMPLE above.
  64.  
  65. SOFTWARE/HARDWARE PREREQUISITES:
  66.  
  67.   IBM VisualAge C++
  68.   OS/2 2.1 or Warp
  69.   IBM or compatible 386 and up.
  70.  
  71. ADDITIONAL INFORMATION:
  72.  
  73.   For more information on the creation and use of projects in the WorkFrame 
  74.   environment, see the VisualAge C++ for OS/2 User's Guide.
  75.  
  76.   For a complete listing and description of samples provided with the 
  77.   VisualAge C++ for OS/2 product, see the VisualAge C++ for OS/2 Guide to 
  78.   Samples.
  79.  
  80.   Both books can be found online.  To access an online book, simply open the 
  81.   main VisualAge C++ desktop folder, then open the Information Folder inside. 
  82.   To view a book, double-click on that book's icon.  
  83.  
  84.  
  85. The files for the sample program are:
  86.  
  87.  READ.ME          - This file.
  88.  
  89.  BUILD.CMD        - A command file to build the sample project from the
  90.                     command line.
  91.  
  92.  SAMPLE04.EXE     - The sample's executable file.
  93.  
  94.  SAMPLE04.C        The source for the 32-bit main function:
  95.  
  96.                   - Makes direct calls to the 16-bit functions plugh1 and
  97.                     plugh2, which are both defined in the 16-bit DLL bound
  98.                     at load time. (See SAMP04A.C which contains the source
  99.                     for plugh1 and plugh2.)
  100.  
  101.                   - Demonstrates a callback function. The 32-bit user function
  102.                     xyzzy is passed to the 16-bit plugh3 routine (defined in
  103.                     SAMP04A.C) with the intent that the 16-bit routine will
  104.                     then call the user function. The xyzzy function is
  105.                     declared using a 16-bit calling convention and is called
  106.                     from the 16-bit DLL, but it is run as a 32-bit function.
  107.  
  108.                   - Uses OS/2 APIs to load the runtime DLL (the source for
  109.                     which is SAMP04B.C) and query the address of the function
  110.                     plugh4. The program then calls plugh4 using the function
  111.                     pointer returned by the API.
  112.  
  113. SAMPLE04.H        The user include file containing function prototypes for
  114.                   the 16-bit functions.
  115.  
  116. 16BIT\SAMP04A.C   The source for functions plugh1, plugh2, and plugh3.
  117. SAMP04A.DEF       The module definition file for the first 16-bit DLL
  118. SAMP04A.DLL       The first 16-bit DLL (bound at load time).
  119.  
  120. 16BIT\SAMP04B.C   The source for function plugh4.
  121. SAMP04B.DEF       The module definition file for the second 16-bit DLL
  122. SAMP04B.DLL       The second 16-bit DLL (bound at run time).
  123.