home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / vxtech12.zip / VXTECH12.TXT < prev   
Text File  |  1995-09-11  |  6KB  |  173 lines

  1. ============================================================================
  2.  VX-REXX Tech Note #12:
  3.                                 Adding splash page support to your projects
  4.  
  5.                                                          September 11, 1995
  6.  
  7.                                          Applies to all versions of VX-REXX
  8.                      
  9. ----------------------------------------------------------------------------
  10.  
  11.                                                        Watcom International
  12.  
  13. ============================================================================
  14.  
  15. This Technical Note builds on the material found in Technical Note #5, 
  16. however you do not need to have Technical Note #5 to use or understand
  17. this one.
  18.  
  19.  
  20. Abstract
  21. --------
  22.  
  23. When VX-REXX builds an executable file from your project (using the
  24. "Make EXE..." menu option), it binds your program to a stub file called
  25. PMEXE.EXE.  This tech note and the accompanying code shows you how to
  26. build your own PMEXE.EXE file.  In particular, this Tech Note shows
  27. you how to add splash screen support to PMEXE, so that your application
  28. can display a splash screen as it loads.
  29.  
  30.  
  31.  
  32. To Add a Splash Screen To Your Project
  33. --------------------------------------
  34.  
  35. To add splash screens to your application, do the following:
  36.  
  37. 1) If you are running VX-REXX 2.0, either upgrade to 2.1 or install
  38.    the resource compiler (VXREZ 1.2, available at the same place you
  39.    got this file).
  40.    
  41. 2) Copy the PMEXE.EXE that accompanies this Tech Note into your
  42.    project's directory.
  43.    
  44. 3) Copy SPLASH.RC into your project directory. 
  45.    
  46. 4) Load your project into VX-REXX and edit its resources.  Add the
  47.    following two lines to the .RC file for your project: 
  48.    
  49.         rcinclude "splash.rc"
  50.         bitmap PMEXE_BITMAP_ID d:\os2\bitmap\os2logo.bmp
  51.         
  52.    Change the path of the bitmap above to whatever bitmap you
  53.    wish to use as your splash screen. 
  54.  
  55. 5) Compile the resource file and then make a .EXE file for your
  56.    project. 
  57.  
  58. When you run the .EXE it will display the bitmap when it
  59. starts up.
  60.  
  61. Note that the splash screen disappears either when the timeout
  62. value has been reached or when the user clicks on it with a 
  63. mouse button.
  64.  
  65.  
  66. Customization of the Splash Screen
  67. ----------------------------------
  68.  
  69. You can change a few parameters by defining macros before 
  70. the "rcinclude" line.  The macros and their
  71. default values are defined in the file "splash.rc".
  72.  
  73. For example, if you wanted to change the timeout value for
  74. the splash screen to 15 seconds and prevent the splash
  75. screen from being hidden once the project has been loaded,
  76. you would do this:
  77.  
  78.      #define PMEXE_TIMEOUT_INTERVAL 15
  79.      #define PMEXE_HIDE_AFTER_LOAD   0
  80.      
  81.      rcinclude "splash.rc"
  82.      bitmap PMEXE_BITMAP_ID d:\os2\bitmap\os2logo.bmp
  83.      
  84. The source is included if you wish to do more extensive customization
  85. than is available with the macros.
  86.  
  87.  
  88. =============== Below is the original text for Tech Note #5 ===============
  89.  
  90. Important Note
  91. --------------
  92.  
  93. This tech note assumes you have either WATCOM C/C++ 9.5 or higher or
  94. IBM's CSet++ 2.1 and know how to compile files.
  95.  
  96.  
  97. PMEXE.EXE's role in life
  98. ------------------------
  99.  
  100. When building an executable, VX-REXX simply takes PMEXE.EXE (found
  101. in your VX-REXX directory) and binds the REXX code and binary window
  102. data to the end of it.  PMEXE.EXE doesn't really do much.  As shipped
  103. with VX-REXX, this is what it does:
  104.  
  105.       1) Finds and loads the VROBJ.DLL runtime library.
  106.       2) Checks to see that the version of VROBJ is at least the
  107.          same version as PMEXE.EXE.
  108.       3) Calls an entry point in the DLL to get things started.
  109.  
  110. That's it.  By building your own PMEXE.EXE and installing it in
  111. the VX-REXX directory (or using VXREZ 1.1 as described later) you can
  112. modify this behaviour.  Why would you?  Well, you might want to display
  113. your own splash page, disable the version warnings, register your
  114. own exe-based REXX external functions, and so on.
  115.  
  116.  
  117. Building a new PMEXE.EXE
  118. ------------------------
  119.  
  120. Building a new PMEXE.EXE is very simple.  Look in the PMEXE directory.
  121. In the H and C subdirectories are the files PMEXE.H and PMEXE.C.  These
  122. contain cover functions that do all the dirty work for you.  All you
  123. need to do is call them from another C file, such as STUB.C which
  124. has been provided for you to examine.  Basically all STUB.C does
  125. is:
  126.  
  127.        -- Calls PMExeLoadDLL to load the DLL
  128.        -- Calls PMExeVersion to check the version number
  129.        -- Calls PMExeRun to run the VX-REXX program.
  130.  
  131. Very simple.  See the README.TXT for notes on how to build the
  132. PMEXE.EXE from the source.  Makefiles have been provided for WATCOM C
  133. and for IBM's CSet.  The code has not been optimized to be as small
  134. and efficient as possible, so there are things you can do to simplify
  135. it if you want.
  136.  
  137. WARNING:  If you do register your own external functions, be sure not
  138.           to register functions that have the same name as one of the
  139.           files in your VX-REXX program, otherwise your program will
  140.           refuse to run....
  141.  
  142.  
  143. Using the new PMEXE.EXE
  144. -----------------------
  145.  
  146. To use the new PMEXE.EXE, you can do one of two things:
  147.  
  148.    1. Make a backup copy of the original PMEXE.EXE in your VX-REXX
  149.       directory.  Copy the new PMEXE.EXE into that directory.  Now
  150.       every executable you make will use that PMEXE.EXE as its
  151.       stub.
  152.  
  153.    2. Get and install VXREZ 1.1, a set of VX-REXX macros that let
  154.       you bind resources to your VX-REXX executables.  (It is available
  155.       the same place you got this tech note from.)  This version of
  156.       VXREZ has a new feature:  if it sees a PMEXE.EXE in the same
  157.       directory as your project's .VRP file, it will bind the resources
  158.       to it and use it as the stub file instead of VX-REXX's own
  159.       PMEXE.EXE.  (Note that if you created a PMEXE.EXE with resources
  160.       already bound to it, the resource compiler will first strip
  161.       off these resources before binding the new ones.)
  162.  
  163. That's it! Have fun....
  164.  
  165.  
  166. Sample Code
  167. -----------
  168.  
  169. There are two subdirectories with sample code.  The PMEXE subdirectory
  170. builds a simple PMEXE.EXE much like the one that comes with VX-REXX 2.0.
  171. The SCAT subdirectory builds a version of PMEXE.EXE that registers
  172. a new external function that the VX-REXX program then uses.
  173.