Menu

Upgrading_from_OWL_1.0

Introduction to OWL 1.0

The first version of the Object Windows Library, introduced in Borland C++ 3.1, used Dynamic Dispatch Virtual Tables (DDVT), a proprietary non-portable extension to C++, to "magically" dispatch the various Windows messages to assigned handlers. A DDVT entry looked like this:

virtual void HandleListBoxMsg(TMessage& Msg) = [ID_FIRST + ID_LISTBOX];

In OWL 2 and later versions, DDVT was replaced by response table macros based on plain C++. A response table entry looks like this:

EV_LBN_SELCHANGE(ID_LISTBOX, LbnSelChange),

Another change was the move from containers using an object-oriented hierarchy to template-based container classes (BIDS).

It is possible to port an OWL 1.0 application to OWLNext with Embarcadero RAD Studio/C++Builder or Microsoft Visual Studio/C++, although in some cases it may be better to redesign and rewrite the user interface from scratch. See Upgrading from OWL for more guidance.


Porting an application based on OWL 1.0 to OWLNext

  1. Upgrade the application to OWL 2. This can be done with the help of the OWLCVT utility, which is included in Borland C++ 4. The last version that has OWLCVT included is version 4.53. (While the utility is mentioned in several places in the documentation for Borland C++ 5, it is unfortunately not included in the product package.)

    Note that OWLCVT is a very old program that has problems running under modern operation systems. If you encounter errors like "unable to create backup file", a possible solution is to try to run the program on a (virtual) machine running Windows XP or earlier.

    OWLCVT usage is covered in detail in the Object Windows Programmer's Guide. Here is how you use it from the Borland C++ 4.5 IDE:

    • Open the project file (".prj") in the IDE.
    • Set the include directories to "C:\BC45\INCLUDE\OWLCVT;C:\BC45\INCLUDE\OWLCVT".
    • Turn off RTTI in the C++ Options.
    • Compile the project and correct all compile-time errors. Don't bother with linking.
    • Select all C++ nodes (".cpp") and run Special | OWL Convert.
    • Turn on RTTI in the C++ Options, and compile the application.
  2. Port your application to 32-bit mode and Win32. Take special care of the usage of int variables, as their size will change.

  3. Upgrade to Borland C++ 5 and OWL 5. One of the changes from OWL 2 is the introduction of the bool type. Also take care of the change of scope of the for-loop control variable. In general, if you plan to port your project to Visual C++, try to achieve compatibility with both compilers and the C++ standard.
  4. Upgrade to Borland C++ 5.5 and OWLNext. See Upgrading from OWL for detailed guidance.
  5. Now you can choose modern development tools and upgrade to the latest version of OWLNext. See Supported Compilers.

Related

Discussion: Converting from OWL 1.0 - how clean do I have to be?
Wiki: Migrating_from_BC_to_VC
Wiki: Supported_Compilers
Wiki: Upgrading_from_OWL

Discussion

  • Ognyan Chernokozhev

    If you plan to port your project to Visual C++, try to achieve compatibility with both compilers.

    I recall that was needed only for Visual C++ 6.0.

    Newer versions of Visual C++ should conform to the standard regarding the scope of the for-loop control variable, although I cannot say exactly when did that occur.

     
  • Vidar Hasfjord

    Vidar Hasfjord - 2023-04-25

    I recall [special care for for-control variable scope] was needed only for Visual C++ 6.0.

    Thanks for pointing that out. I thought the comment related to cross-compiler compatibility in general. I'll make it clear.

    On the for-loop scope issue — I do remember it now, and I seem to recall it lingered in the Microsoft compiler for longer than I liked, along with other peculiarities. However, latest Microsoft compilers are now wondrously compatible with the latest C++ standards, I am glad to say.

     
    • Ognyan Chernokozhev

      Maybe we can clarify by changing that sentence to "If you plan to port your project to older versions of Visual C++"

       
  • Vidar Hasfjord

    Vidar Hasfjord - 2023-04-25

    Maybe we can clarify by changing that sentence to "If you plan to port your project to older versions of Visual C++"

    I updated the article before I saw your comment. I tried to generalise the bullet point to comprise all language related compatibility issues. Hopefully, it is clear now. However, feel free to make any changes to improve it or other parts of this article, so that we can make the porting process as smooth as possible for users that still have old code they would like to modernise.

     

    Last edit: Vidar Hasfjord 2023-04-25
  • Vidar Hasfjord

    Vidar Hasfjord - 2023-04-29

    Nice update, Jogy, about the issue with OWLCVT on modern operating systems. I've improved the formatting and language a little (bold, line breaks, spelling/grammar).

     
    • Ognyan Chernokozhev

      Looks great, thanks!

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.