home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 May / Pcwk5b98.iso / Borland / Cplus45 / BC45 / OWL1.PAK / 1OWL45.TXT < prev    next >
Text File  |  1995-08-29  |  8KB  |  177 lines

  1. 1OWL45.TXT - Developing OWL 1.0 applications in Borland C++ 4.5
  2. (C) Copyright 1995 by Borland International
  3.  
  4.  
  5. Contents:
  6. ========
  7.    Using ObjectWindows 1.0 with Borland C++ 4.5
  8.    Building the Obsolete object-based container library
  9.    Building ObjectWindows 1.0
  10.  
  11.  
  12. Using ObjectWindows 1.0 with Borland C++ 4.5
  13. ============================================
  14.  
  15. You can easily build OWL 1.0 applications in the Borland C++ 4.5 IDE and
  16. have full access to all the new features of the IDE except for AppExpert
  17. and ClassExpert. Due to changes in the debug information format, symbol
  18. length, and runtime library, ObjectWindows and the obsolete object-based
  19. container library must be built with the current compiler.
  20.  
  21. First build the container library (see the section "Building the Obsolete
  22. object-based container library"). When you have a successful build of the
  23. container library, build ObjectWindows library (see the section "Building
  24. ObjectWindows 1.0").
  25.  
  26. In the Integrated Development Environment, you may find it easiest to
  27. create a style sheet with the required settings, then create a new project
  28. and apply the style sheet to it, and add your original project source files
  29. to the new project.
  30.  
  31. Alternatively, you can load the original *.prj project file into the IDE
  32. using the Project | Open menu and changing settings in the new project file
  33. (the Integrated Development Enviornment will create a new-style *.ide
  34. project file when it reads the *.prj file).
  35.  
  36. Upon creating a new file, make the following selections in the TargetExpert
  37. dialog (for converted projects, TargetExpert can be accessed via the speed
  38. menu in the Project View):
  39.  
  40.      Target Type:       Application [.exe]
  41.      Platform:          Windows 3.x (16)
  42.      Target Model:      [Whatever's appropriate.  Usually large model.]
  43.      Standard Libraries:
  44.         OWL:                 Unchecked
  45.         Class Library:       Unchecked
  46.         RTL:                 Checked
  47.         Dynamic/static radio button either way.
  48.  
  49. Also, select the type of runtime library in TargetExpert by selecting the
  50. Dynamic or Static radio button. Remember that the rutime, container and OWL
  51. libraries must be either all static or all dynamic.
  52.  
  53. Note that you must not select OWL and Class Library as the Project Manager
  54. will assume you mean OWL 2.5 and the template-based container. Instead,
  55. after the project is created, add the appropriate ObjectWindows and
  56. container libraries to the project.
  57.  
  58. The following options must be set either by using the Options | Project
  59. menu or by applying an appropriate Style Sheet.
  60.  
  61.    1. Under Directories, set the include path to:
  62.  
  63.          \bc45\include;\bc45\include\classlib\obsolete;\bc45\include\owl1
  64.  
  65.       Include drive letters if necessary.
  66.  
  67.    2. Under C++ Options | Exception Handling/RTTI, uncheck all checkboxes
  68.       on this page. The binary implementation for RTTI conflicts with the
  69.       DDVT's used by OWL 1.0 and exception handling requires RTTI to
  70.       operate correctly, so neither of these new features can be used in
  71.       your OWL 1.0 code.
  72.  
  73.    3. Under 16-bit Compiler|Entry/Exit Code, select Windows smart
  74.       callbacks, all functions exportable.
  75.  
  76.    4. Under Compiler|Defines, add defines for strict mode and Windows 3.1.
  77.       Multiple defines are semi-colon-delimeted with no white space (ie,
  78.       WIN31;STRICT;_CLASSDLL).
  79.  
  80.       Note: Strict mode makes distinct types of Windows types that are
  81.       otherwise all macro-defined to type int; thus, you might have to make
  82.       some modifications to your code to get it to compile. For example, If
  83.       the first two parameters of your WinMain function are given as
  84.       HANDLE, you will need to change them to HINSTANCE as these become
  85.       distinct types in strict mode. In addition to potentially identifying
  86.       at compile time assignments or usages that would cause run-time
  87.       errors, using strict mode will make your code easier to port to
  88.       later versions of ObjectWindows, which require the mode.
  89.  
  90.    4. If you are using the dynamic version of OWL, under Compiler|Defines
  91.       add the symbol _CLASSDLL to the edit field.
  92.  
  93. Be sure to select Project|Build all to avoid inadvertently linking in any
  94. binary files (object modules, resource files, etc) that were compiled in
  95. an earlier version of Borland C++.
  96.  
  97.  
  98.   Notes and Optimizations:
  99.  
  100.   1. You may receive a number of warnings similar to this one:
  101.  
  102.      Warning INFO.H 124: 'TInfoWindow::Paint(const HDC__ near*,
  103.      tagPAINTSTRUCT &)' hides virtual function 'TWindow::Paint(void *,
  104.      void *)'
  105.  
  106.      This warning is for a situation in which the function Paint() has been
  107.      overloaded and only one of the different types has been defined in the
  108.      derived class.  Thus the type that was not defined is hidden by the
  109.      one that was.  TWindow::Paint( void *, void * ) is never called by
  110.      OWL, but is used to pad the VTable so there are always two entries for
  111.      TWindow::Paint. You can safely ignore this warning, but if you wish to
  112.      make it go away, add the second version of the Paint() to the derived
  113.      class, and have it do nothing, e.g. for the case above do this:
  114.  
  115.         class TInfoWindow : public TWindow
  116.         {
  117.         public:
  118.            ...
  119.            virtual void Paint( HDC PaintDC,
  120.                                PAINTSTRUCT& PaintInfo );
  121.            virtual void Paint( void *, void * ) {}
  122.            ...
  123.         };
  124.  
  125.  
  126.   2. If you used any of your own or third party C++ class libraries in your
  127.      OWL 1.0 application, you will have to rebuild those libraries using
  128.      the Borland C++ 4.5 compiler, or the resulting code may not link and
  129.      run properly.
  130.  
  131.   3. If you wish to use the OWL library with debug info, we recommend you
  132.      use the DLL version.
  133.  
  134.  
  135. Building the Obsolete object-based container library
  136. ====================================================
  137.  
  138. The object based class library is now considered obsolete, having been
  139. replaced by the template-based container library. However, Borland C++ 4.5
  140. does include source code and makfile for building the object-based library.
  141.  
  142. To build the dynamic and large model static libraries with and without
  143. debugging information, change to the \bc45\source\classlib and use the
  144. BUILDCLS.BAT batch file placed there by unpacking OWL1.PAK.
  145.  
  146. The build process will create the following files in the \bc45\lib
  147. directory:
  148.  
  149.    tclasd45.dll   dynamic library map file with debug info
  150.    tclasd45.map   dynamic library with debug info
  151.    tclasdi.lib    import library with debug info
  152.    tclasdl.lib    static library in large model with debug info
  153.    tclass45.dll   dynamic library
  154.    tclass45.map   dynamic library map file
  155.    tclassi.lib    import library
  156.    tclassl.lib    static library in large model
  157.  
  158. The map files can be used to create *.sym symbol files. The *.dll dynamic
  159. libraries should be copied to your bc45\bin directory.
  160.  
  161.  
  162. Rebuilding ObjectWindows 1.0 with Borland C++ 4.5
  163. ==================================================
  164.  
  165. When you unpacked OWL1.PAK, the source files for ObjectWindows were placed
  166. at \bc45\source\owl1, and the header files at \bc45\include\owl1. To build
  167. ObjectWindows large model static library and dynamic link library, change
  168. to the \bc45\source\owl1\source directory and run 1OWL45BL.BAT.
  169.  
  170. By default, the process will create these files:
  171.  
  172.       \bc45\bin\owl1a.dll    dynamic library
  173.       \bc45\bin\owl1a.tds    debug info for dynamic library
  174.       \bc45\lib\owl1ai.lib   import library
  175.       \bc45\lib\owl1awl.lib  static library in large model
  176.  
  177.