Hi to everyone,

Turbo Vision is a C++ class library that allows a user to create good
applications, but there are some bugs in it.  One should modify the
sources and remove these bugs.  Whenever a bug is published, Eric
Woodruff [72134,1150] tests the information and puts it into a list
available here on CIS in BCPPDOS, lib 11, name: TV2BUG.ZIP.

You can download the list and apply the modifications as suggested.
This takes about an hour or so.  With the files included here you can do
it in seconds.


What you get:
This archive contains the following files

      - README.TXT
        you are currently reading it

      - EDITS.16, HARDWARE.16, SYSINT.16, TTPRVLNS.16 and TVCURSOR.16
        these replace the OBJ files that contain buggy ASM code.

      - EDITS.32, HARDWARE.32, SYSINT.32, TTPRVLNS.32 and TVCURSOR.32
        these replace the OBJ files that contain buggy ASM code.

      - PAT_SRC.COM
        this program applies the patches to the original TV sources

      - PAT_HEAD.COM
        this program applies the patches to the original TV header files

After applying the patches you have the modifications as described
in TV2BUG.ZIP dated 07/06/95. I will soon explain how to do this.

There are also bugs in the ASM modules.  Unfortunately Borland did not
include the assembler in the compiler package so if you do not purchase
the assembler you cannot apply the patches to the ASM modules. Eric put
the OBJ modules generated after modifying them in his TV2BUG.ZIP file so
you would be able to simply replace them. I will follow his idea.

     DISCLAIMER
     ==========
         THIS SOFTWARE AND DOCUMENTATION ARE DISTRIBUTED "AS IS" AND
     WITHOUT WARRANTIES AS TO PERFORMANCE OF MERCHANTABILITY OR ANY
     OTHER WARRANTIES WHETHER EXPRESSED OR IMPLIED.  BECAUSE OF THE
     VARIOUS HARDWARE AND SOFTWARE ENVIRONMENTS INTO WHICH THIS PRODUCT
     MAY BE PUT, NO WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE IS
     OFFERED.  THE USER MUST ASSUME THE ENTIRE RISK OF USING THE
     SOFTWARE.  I WILL NOT BE RESPONSIBLE FOR ANY DAMAGE OR LOSS OF
     TIME, DATA, HARDWARE, OR SOFTWARE YOU INCUR THROUGH USE OF THIS
     PRODUCT.

how to ...
Now I want to describe how to apply the patches. There are 2 programs
in this archive that do this automatically for you and within seconds
everything is done. But these programs expect the original sources and the
original header files as Borland delivered them. If you changed a byte in one
of the files this file will not get updated!

In this case you can:

    - do the modifications by yourself
or
    - let the patch program do the modifications on the original files
      and then apply your own modifications later.

The first step for applying the patches is to put the sources (usually
in the directory SOURCE\TVISION if you did not change the install
procedure) and the header files (in INCLUDE\TVISION) in a safe place.
You may need them later for the following cases:

    - something is going wrong within the patch step

    - new bugs or modifications are published
      and this patch program only works with the originals!

AFTER you do this you can easily apply the patches:

    - jump to the directory, e.g. with the sources
            CD   SOURCE\TVISION

    - now start the included program:
            PAT_SRC

Within some seconds the files in the current directory are modified.
You must do this with the sources  (program PAT_SRC.COM) and the
header directory (program PAT_HEAD.COM).

If you have the assembler you can now call MAKE and recompile the whole
sources. If you do not have the assembler you must go the following way:
    - store your original files in a safe place
        for the 16-bit application these files
           are located in the directory LIB\COMPAT\TV,
        for the 32-bit application these files
           are located in the directory LIB\COMPAT\TV32

    - this archive contains files with the extension 16 and 32.
      These files replace the files with same name and the extension
      OBJ in the directory, e.g.
          EDITS.16 replaces EDITS.OBJ in the directory LIB\COMPAT\TV
      so you must copy them to this directory and rename them to the
      extension OBJ.
      And similar:
          HARDWARE.32 replaces HARDWARE.OBJ in the directory LIB\COMPAT\TV32

      and so on with all four files with the extension 16 and
      also with the extension 32.

Now you can call MAKE and tell it to not assemble the modules:

      MAKE    -DNOTASM

which creates the 16-bit version of the library.

      MAKE    -DNOTASM    -DDOS32

will create the 32-bit version of the library.

Everything is done now.  Good luck.


Error messages:
the patch program reports 'incorrect' if the the file it wants to
modify is not equal to the original file. It will not apply any
patches to such a file, it beeps instead.

After applying the patches you have 2 versions of the files :
one like     $CLUSTER.CPP    the original file
and another  TCLUSTER.CPP    the patched file.
Do what ever you want with the old files if you have them also
saved in a safe place.


a bonus:
Some programmers don't want or need the streaming support included
in Turbo Vision. So I added NO_STREAMABLE to the sources and the
header files. Eric reported a reduction in size of about 30K
and I saw a savings of about 70K. The modifications will be done
automatically when you call PAT_SRC and PAT_HEAD. They will
be harmless until you call MAKE with -DNO_STREAMABLE.
But now you must have the assembler because the layout of the classes
changed and the offset of variables differs! The code in the ASM modules
will cause a crash if you do not reassemble these modules.

Luckily Borland included a program which is generated when you call MAKE
_without_ -DNOTASM. This program generates a file TVWRITE.INC which
contains the equates needed. So everything is handled automatically
but only IF YOU HAVE THE ASSEMBLER!


some hints
you should look into TV2BUG.ZIP if you want to know more about the bugs
of TV version 2.0. Eric maintains this list and helps everyone
here in BCPPDOS.

The patch process is done using WSP, a program available here on CIS
in the german MAGNA forum (old name: MUT, don't know when this will
be changed). The language in this forum is German but there is a
description in english in the package. The file name is WSP150.ARJ
and you need the compression program ARJ to unpack this archive.

August Quint
