1OWL45.TXT - Developing OWL 1.0 applications in Borland C++ 4.5 (C) Copyright 1995 by Borland International Contents: ======== Using ObjectWindows 1.0 with Borland C++ 4.5 Building the Obsolete object-based container library Building ObjectWindows 1.0 Using ObjectWindows 1.0 with Borland C++ 4.5 ============================================ You can easily build OWL 1.0 applications in the Borland C++ 4.5 IDE and have full access to all the new features of the IDE except for AppExpert and ClassExpert. Due to changes in the debug information format, symbol length, and runtime library, ObjectWindows and the obsolete object-based container library must be built with the current compiler. First build the container library (see the section "Building the Obsolete object-based container library"). When you have a successful build of the container library, build ObjectWindows library (see the section "Building ObjectWindows 1.0"). In the Integrated Development Environment, you may find it easiest to create a style sheet with the required settings, then create a new project and apply the style sheet to it, and add your original project source files to the new project. Alternatively, you can load the original *.prj project file into the IDE using the Project | Open menu and changing settings in the new project file (the Integrated Development Enviornment will create a new-style *.ide project file when it reads the *.prj file). Upon creating a new file, make the following selections in the TargetExpert dialog (for converted projects, TargetExpert can be accessed via the speed menu in the Project View): Target Type: Application [.exe] Platform: Windows 3.x (16) Target Model: [Whatever's appropriate. Usually large model.] Standard Libraries: OWL: Unchecked Class Library: Unchecked RTL: Checked Dynamic/static radio button either way. Also, select the type of runtime library in TargetExpert by selecting the Dynamic or Static radio button. Remember that the rutime, container and OWL libraries must be either all static or all dynamic. Note that you must not select OWL and Class Library as the Project Manager will assume you mean OWL 2.5 and the template-based container. Instead, after the project is created, add the appropriate ObjectWindows and container libraries to the project. The following options must be set either by using the Options | Project menu or by applying an appropriate Style Sheet. 1. Under Directories, set the include path to: \bc45\include;\bc45\include\classlib\obsolete;\bc45\include\owl1 Include drive letters if necessary. 2. Under C++ Options | Exception Handling/RTTI, uncheck all checkboxes on this page. The binary implementation for RTTI conflicts with the DDVT's used by OWL 1.0 and exception handling requires RTTI to operate correctly, so neither of these new features can be used in your OWL 1.0 code. 3. Under 16-bit Compiler|Entry/Exit Code, select Windows smart callbacks, all functions exportable. 4. Under Compiler|Defines, add defines for strict mode and Windows 3.1. Multiple defines are semi-colon-delimeted with no white space (ie, WIN31;STRICT;_CLASSDLL). Note: Strict mode makes distinct types of Windows types that are otherwise all macro-defined to type int; thus, you might have to make some modifications to your code to get it to compile. For example, If the first two parameters of your WinMain function are given as HANDLE, you will need to change them to HINSTANCE as these become distinct types in strict mode. In addition to potentially identifying at compile time assignments or usages that would cause run-time errors, using strict mode will make your code easier to port to later versions of ObjectWindows, which require the mode. 4. If you are using the dynamic version of OWL, under Compiler|Defines add the symbol _CLASSDLL to the edit field. Be sure to select Project|Build all to avoid inadvertently linking in any binary files (object modules, resource files, etc) that were compiled in an earlier version of Borland C++. Notes and Optimizations: 1. You may receive a number of warnings similar to this one: Warning INFO.H 124: 'TInfoWindow::Paint(const HDC__ near*, tagPAINTSTRUCT &)' hides virtual function 'TWindow::Paint(void *, void *)' This warning is for a situation in which the function Paint() has been overloaded and only one of the different types has been defined in the derived class. Thus the type that was not defined is hidden by the one that was. TWindow::Paint( void *, void * ) is never called by OWL, but is used to pad the VTable so there are always two entries for TWindow::Paint. You can safely ignore this warning, but if you wish to make it go away, add the second version of the Paint() to the derived class, and have it do nothing, e.g. for the case above do this: class TInfoWindow : public TWindow { public: ... virtual void Paint( HDC PaintDC, PAINTSTRUCT& PaintInfo ); virtual void Paint( void *, void * ) {} ... }; 2. If you used any of your own or third party C++ class libraries in your OWL 1.0 application, you will have to rebuild those libraries using the Borland C++ 4.5 compiler, or the resulting code may not link and run properly. 3. If you wish to use the OWL library with debug info, we recommend you use the DLL version. Building the Obsolete object-based container library ==================================================== The object based class library is now considered obsolete, having been replaced by the template-based container library. However, Borland C++ 4.5 does include source code and makfile for building the object-based library. To build the dynamic and large model static libraries with and without debugging information, change to the \bc45\source\classlib and use the BUILDCLS.BAT batch file placed there by unpacking OWL1.PAK. The build process will create the following files in the \bc45\lib directory: tclasd45.dll dynamic library map file with debug info tclasd45.map dynamic library with debug info tclasdi.lib import library with debug info tclasdl.lib static library in large model with debug info tclass45.dll dynamic library tclass45.map dynamic library map file tclassi.lib import library tclassl.lib static library in large model The map files can be used to create *.sym symbol files. The *.dll dynamic libraries should be copied to your bc45\bin directory. Rebuilding ObjectWindows 1.0 with Borland C++ 4.5 ================================================== When you unpacked OWL1.PAK, the source files for ObjectWindows were placed at \bc45\source\owl1, and the header files at \bc45\include\owl1. To build ObjectWindows large model static library and dynamic link library, change to the \bc45\source\owl1\source directory and run 1OWL45BL.BAT. By default, the process will create these files: \bc45\bin\owl1a.dll dynamic library \bc45\bin\owl1a.tds debug info for dynamic library \bc45\lib\owl1ai.lib import library \bc45\lib\owl1awl.lib static library in large model