home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 May / Pcwk5b98.iso / Borland / Cplus45 / BC45 / DOC.PAK / COMPAT.TXT < prev    next >
Text File  |  1995-08-29  |  15KB  |  424 lines

  1. COMPAT.TXT - Compatibility Information
  2. (C) Copyright 1995 by Borland International
  3.  
  4.  
  5. Contents:
  6. ========
  7.    Using ObjectWindows 1.0 with Borland C++ 4.5
  8.    Downloading OWL1.PAK
  9.    Using Turbo Assembler 4.0 with Borland C++ 4.5
  10.    Using the Object Based Class Library with Borland C++ 4.5
  11.    Using Turbo Vision 1.0x with Borland C++ 4.5
  12.    Using the Paradox Engine and Database Frameworks with BC 4.5
  13.  
  14.  
  15. Using ObjectWindows 1.0 with Borland C++ 4.5
  16. ============================================
  17.  
  18. The ObjectWindows 1.0 library can be built with Borland C++ 4.5 for
  19. developing OWL 1.0 native applications. With the increased capacity of the
  20. Borland tools as compared to Borland C++ 3.1, you can now use OWL libraries
  21. with full symbolic debug information and debug your application in either
  22. the Integrated Development Environment or in Tubro Debugger for Windows.
  23.  
  24. The overall process requires modifying ObjectWindows source files and
  25. rebuilding the object-based container library as well as ObjectWindows. All
  26. necessary files are contained in OWL1.PAK which is on the Borland C++
  27. compact disk in the \bc45\install directory. If you obtained Borland C++ on
  28. 5-1/4" disks instead of compact disk, you will need to download OWL1.PAK
  29. from Borland's ftp site, local bulletin board, or CompuServe. (See
  30. "Downloading OWL1.PAK".)
  31.  
  32. To begin the process, copy OWL1.PAK to the \bc45 directory and use
  33. unpaq.exe (in the \bc45 directory) to extract the files. When using unpaq,
  34. be sure to set:
  35.  
  36.    Restore directories: checked
  37.    Archive name:        \bc45\owl1.pak
  38.    Destination dir:     \bc45
  39.  
  40. Next, select Open archive. By default, all files are selected and if you
  41. de-select any, they will not be installed. Now select Decompress.
  42.  
  43. Building and using ObjectWindows and the object-based container library are
  44. described in 1OWL45.TXT which you will now find in the directory
  45. \bc45\source\owl1.
  46.  
  47.  
  48.  
  49. Downloading OWL1.PAK
  50. ====================
  51.  
  52. OWL1.PAK can be obtained from the following sources:
  53.  
  54.    Borland's anonymous ftp site: ftp.borland.com
  55.  
  56.    CompuServe: !go BCPPWin and look in library 2.
  57.  
  58.    Borland's Download Bulletin:
  59.       The DLBBS can be dialed at 408-431-5096. Simply join the C++
  60.       Conference (number 12). And from the File menu, select download
  61.       and enter OWL1.PAK (you do not need to be in the specific file
  62.       area).
  63.  
  64.  
  65. Using Turbo Assembler 4.0 with Borland C++ 4.5
  66. ==============================================
  67. Turbo Assembler 4.0 is fully compatible with Borland C++ 4.5.  There is
  68. an error in the WHEREIS example program which will cause two undefined
  69. symbol errors when built.  The following corrections will resolve the
  70. problem:
  71.  
  72. In file \examples\tasm\whereis\iexedos.asm
  73. line 118, change:
  74. mov es,[es:psp.EnvironmentBlock]
  75. to:
  76. mov es,[es:Psp.EnvironmentBlock]
  77.  
  78. line 196, change:
  79. mov ax, [ComSpecSeg]
  80. to:
  81. mov ax, [ComspecSeg]
  82.  
  83. In file \examples\tasm\whereis\whereis.asm
  84. line 448, change:
  85. endp main
  86. to:
  87. endp Main
  88.  
  89. line 565, change:
  90. call WriteAsciizString,ds,offset Syntax
  91. to:
  92. call WriteASCIIZString,ds,offset Syntax
  93.  
  94.  
  95. Using the Object Based Class Library with Borland C++ 4.5
  96. =========================================================
  97.  
  98. The object based class library, while still included with Borland C++
  99. 4.5, must be compiled before it can be used.  Here are instructions for
  100. doing so:
  101.  
  102. There is a makefile in the source directory, \BC45\SOURCE\CLASSLIB which
  103. can be used to build all versions of the class library.  For example, to
  104. build a large model static version for use with Object Windows, run the
  105. following command:
  106.  
  107.    MAKE -DDOS -DOBJECTS "-DBCC=bcc -x-" -DMODEL=l -DNAME=tclassl
  108.  
  109. To build a debugging dynamic version of the class library DLL, run the
  110. following command:
  111.  
  112.    MAKE -DDOS -DDBG -DOBJECTS "-DBCC=bcc -x-" -DDLL -DNAME=tclass
  113.  
  114. Note that to successfully use the DLL version of the class library you will
  115. have to copy TCLASS40.DLL from the \BC45\LIB directory into the \BC45\BIN
  116. directory.
  117.  
  118.  
  119.  
  120. Using Turbo Vision 1.0x with Borland C++ 4.5
  121. ============================================
  122.  
  123. REBUILDING THE TURBO VISION LIBRARY:
  124.  
  125. Due to changes in the debug information format, symbol length, and
  126. runtime library, the Turbo Vision 1.0 library must be recompiled with
  127. Borland C++ 4.5.  Note that Turbo Vision 2.0 is fully compatible with
  128. Borland C++ 4.5 and does not require the modifications in this section.
  129.  
  130. There are a few minor changes that need to be made to the source code
  131. before recompiling it with the new compiler.  These are due to slightly
  132. tightened syntax restrictions.  The makefile will require some
  133. modification as well, which are shown below.
  134.  
  135. There are 3 steps to this process:
  136.  
  137.    1. Copy the old 3.1 Turbo Vision source into the new BC45 directory
  138.       structure.
  139.    2. Make the appropriate changes according to the instructions below.
  140.    3. Run MAKE to build the new Turbo Vision library you need to
  141.       continue your work.  If you are using Turbo Vision in an overlaid
  142.       application, make sure you follow the instructions specific to
  143.       overlays.
  144.  
  145. These steps are now presented in more detail:  Note that the Borland C++
  146. root directory is assumed to be \BC45.  Change this as necessary for your
  147. particular installation.  Also, if you are upgrading from Borland C++
  148. 2.0 and have the original version of Turbo Vision, some of the line
  149. numbers mentioned may not accurately reflect your version.
  150.  
  151. You need to copy your old Turbo Vision source and include files from
  152. Borland C++ 3.1 into your Borland C++ 4.5 directory hierarchy.  To do
  153. this, just run the following command:
  154.  
  155.    XCOPY \BC31\TVISION \BC45\TVISION /S
  156.  
  157. and when it asks you about creating a directory called TVISION, say yes.
  158. Modify the above paths according to your system configuration if
  159. necessary.  You are now ready to make the necessary modifications before
  160. rebuilding the library.
  161.  
  162. The changes are as follows:
  163.  
  164. 1. Due to tighter syntax checking, case blocks that declare initialized
  165.    local variables need their own scoping block.  Make the changes below
  166.    in the order shown so that confusion over the correct line numbers
  167.    can be avoided.  In general, the '{' follows a case statement, and
  168.    the '}' follows a break statement.
  169.  
  170.    COLORSEL.CPP
  171.  
  172.       Add after line 219:  }
  173.       Add after line 179:  {
  174.       Add after line 177:  }
  175.       Add after line 164:  {
  176.  
  177.    TBUTTON.CPP
  178.  
  179.       Add after line 226:  }
  180.       Add after line 211:  {
  181.       Add after line 209:  }
  182.       Add after line 192:  {
  183.  
  184. 2. TINPUTLIN.CPP
  185.    Replace line 44:  if( (p = strchr( s, '~' )) != 0 )
  186.    With              if( (p = (char*) strchr( s, '~' )) != 0)
  187.  
  188. 3. TMNUVIEW.CPP
  189.    Replace line 348:  char *loc = strchr( p->name, '~' );
  190.    With               char *loc = (char*)strchr( p->name, '~' );
  191.  
  192. 4. TVWRITE.ASM
  193.    Replace line 25:  PUBLIC  @TView@writeChar$qsszcucs
  194.    With              PUBLIC  @TView@writeChar$qsscucs
  195.  
  196.    Replace line 27:  PUBLIC  @TView@writeStr$qssnxzcuc
  197.    With              PUBLIC  @TView@writeStr$qssnxcuc
  198.  
  199.    Replace line 366:  PROC    @TView@writeChar$qsszcucs
  200.    With               PROC    @TView@writeChar$qsscucs
  201.  
  202.    Replace line 436:  PROC    @TView@writeStr$qssnxzcuc
  203.    With               PROC    @TView@writeStr$qssnxcuc
  204.  
  205.    Note that all of the above changes simply entail removing
  206.    the letter 'z' from the last part of the mangled symbol
  207.    name.
  208.  
  209. 5. MAKEFILE
  210.    Replace line 100:
  211.       CFLAGS = -c $(CCOVYFLAGS) -P -O1 -m$(MODEL) -I$(INCLUDE) -n$(OBJDIR)
  212.    With
  213.       CFLAGS = -c -x- $(CCOVYFLAGS) -P -O1 -m$(MODEL) -I$(INCLUDE) -n$(OBJDIR)
  214.  
  215.    Replace line 73:
  216.       TLIB = $(BCROOT)\bin\tlib /0
  217.    With this group of 5 lines:
  218.       !ifdef DEBUG
  219.          TLIB = $(BCROOT)\bin\tlib
  220.       !else
  221.          TLIB = $(BCROOT)\bin\tlib /0
  222.       !endif
  223.  
  224.    *** If you did NOT purchase the Turbo Assembler add-on package for
  225.    Borland C++ 4.5, you must make some additional changes.
  226.  
  227.    Replace the group at lines 259-263:
  228.       !if $d(BC)
  229.          $(TASM) $&.asm, $(OBJDIR)\$&.obj
  230.       !else
  231.          copy $(TVLIBDIR)\$&.obj $(OBJDIR)
  232.       !endif
  233.    With this group:
  234.       !if !$d(NOTASM)
  235.          $(TASM) $&.asm, $(OBJDIR)\$&.obj
  236.       !else
  237.          copy $(LIBDIR)\COMPAT\$&.obj $(OBJDIR)
  238.       !endif
  239.  
  240.    Add after line 49:
  241.       NOTASM = 1
  242.  
  243.  
  244. USE OF EXCEPTION HANDLING WITH TURBO VISION:
  245.  
  246. Turbo Vision was designed with its own global new operator.  Due to this
  247. internal design you will not be able to use exception handling with the
  248. new operator. However, any other type of exception handling is
  249. supported. In order to enable exception handling do not make the change
  250. to line 88 of the makefile.
  251.  
  252.  
  253. USE OF OVERLAYS WITH TURBO VISION:
  254.  
  255. ** Note: All instructions in this section are in addition to the changes
  256. recommended above.
  257.  
  258. As with Borland C++ 3.1, Turbo Vision can be used in an overlayed program
  259. if the library is rebuild with certain options, shown below:
  260.  
  261.    All overlayed modules must be compiled with local virtual tables (-Vs).
  262.  
  263.    Overlayed modules no longer need to be compiled via assembler (-B).
  264.  
  265.    Overlayed modules must be compiled with exceptions disabled (-x-).
  266.  
  267. Here are the steps required to build an overlayable version of TV.LIB:
  268.  
  269. 1. First make an additional change to file TVISION\SOURCE\MAKEFILE:
  270.  
  271.    Change line 96 from : CCOVYFLAGS = -Y -Vs -B
  272.                     to : CCOVYFLAGS = -Y -Vs
  273.  
  274. 2. Change to the \BC45\TVISION\LIB directory and make a backup copy of
  275.    TV.LIB by typing:
  276.  
  277.    COPY TV.LIB OLDTV.LIB
  278.  
  279. 3. Switch to the \BC45\TVISION\SOURCE directory and type:
  280.  
  281.    MAKE -B -DOVERLAY
  282.  
  283. 4. This will create a new TV.LIB in the \BC45\TVISION\LIB directory.
  284.    There are seven modules in TV.LIB which cannot be overlayed.  The
  285.    easiest solution to this problem is to create three seperate
  286.    libraries.  Two libraries will be used when creating overlayed TV
  287.    apps, and the original TV.LIB will remain for use in non-overlayed TV
  288.    apps:
  289.  
  290.     TV.LIB   - full TV lib for use in non-overlayed TV apps
  291.     TVO.LIB  - overlayable modules of TV.LIB
  292.     TVNO.LIB - non-overlayable modules of TV.LIB
  293.  
  294.    To create these libraries, switch into the TVISION\LIB directory and
  295.    type the following commands:
  296.  
  297.     TLIB TV.LIB -*SYSERR -*TSCREEN -*DRIVERS -*DRIVERS2 -*SWAPST -*TEVENT -*SYSINT
  298.     TLIB TVNO.LIB +SYSERR +TSCREEN +DRIVERS +DRIVERS2 +SWAPST +TEVENT +SYSINT
  299.     RENAME TV.LIB TVO.LIB
  300.     RENAME TVOLD.LIB TV.LIB
  301.     DEL *.OBJ *.BAK
  302.  
  303. 5. You will now have the three libraries.  To create an overlayed Turbo
  304.    Vision application, include both TVO.LIB and TVNO.LIB in the project
  305.    file or link line of the makefile.  Using the local options for each
  306.    item, mark TVO.LIB as overlayed and TVNO.LIB as non-overlayed.  Also,
  307.    go to the TargetExpert dialog box for this target and uncheck the
  308.    Turbo Vision Library.
  309.  
  310.  
  311.  
  312. Using the Paradox Engine And Database Frameworks with BC 4.5
  313. ============================================================
  314.  
  315. THE PARADOX ENGINE
  316.  
  317. There is only one significant detail regarding the use of the Paradox
  318. Engine 3.0x with Borland C++ 4.5.  The BC 3.1 versions of setjump and
  319. longjump will have to be linked into your application in order to create
  320. DOS Paradox Engine and Database Framework applications.  The object
  321. module, setjmp.obj, is provided in the BC45\LIB\COMPAT directory. Linking
  322. this module into your application will replace the BC 4.5 version of
  323. these functions.  To do this, simply add the file
  324. \BC45\LIB\COMPAT\SETJMP.OBJ to your project file or to the link command
  325. in your makefile.
  326.  
  327.  
  328. REBUILDING THE DATABASE FRAMEWORKS
  329.  
  330. Due to changes in the debug information format, symbol length, and
  331. runtime library, the Database Framework library must be recompiled with
  332. Borland C++ 4.5.
  333.  
  334. A number of changes will have to be made to the Paradox Engine DBF v3.01
  335. makefile in order for it to work with BC 4.5 (this makefile is available
  336. from our local BBS at (408) 431-5096 as the file TI1169.ZIP and from
  337. TechFax at (800) 822-4269, document number 1169):
  338.  
  339. 1. Copy makefile.bc to make40.mak
  340.  
  341. 2. Make certain that a turboc.cfg file exists in the BC45\BIN directory
  342.    containing:
  343.  
  344.       -Ic:\bc45\include
  345.       -Lc:\bc45\lib
  346.  
  347.    Make certain that a tlink.cfg file exist in the BC45\BIN directory
  348.    containing:
  349.  
  350.       -Lc:\bc45\lib
  351.  
  352.    Adjust the above paths to reflect your systems' configuration.
  353.  
  354. 3. Make the following changes:
  355.  
  356.    Line 83: Change the 'CCINCLUDE=' line to contain the path to the BC
  357.             4.5 include directory.
  358.    Line 168: Delete the blank space at the end of the 'DEBUGFLAG=v ' line
  359.    Line 172: Delete the blank space at the end of the 'DYNAMICFLAG=d ' line
  360.    Line 202: Add '-DWindows' after '-DWINDOWS'
  361.    Line 204: Add '-DWindows' after '-DWINDOWS'
  362.    Line 206: Add '-DWindows' after '-DWINDOWS'
  363.    Line 239: Replace '$D' with 'BuildDir'
  364.    Line 249: Replace '$D' with 'BuildDir'
  365.    Line 261: Replace '$D' with 'BuildDir'
  366.  
  367. Then use the following command to create a Database Framework Library.
  368. Add one or both of the options -DDBG and -DWINDOWS to add debug info or
  369. build for use in WINDOWS code. (Refer to the makefile for even more
  370. options.)
  371.  
  372.    make -fmake40.mak
  373.  
  374. For example, the following command will create a large model, static
  375. windows DBF library with debug info:
  376.  
  377.    make -DWINDOWS -DDBG -fmake40.mak
  378.  
  379. The libraries will be created in the PXENG30\C\LIB directory.  These
  380. libraries are now ready for use in your Database Frameworks Program.
  381.  
  382.  
  383. CHANGES TO USER CODE WITH RESPECT TO DBF
  384.  
  385. The only change to your source code involves the use of the 'new'
  386. operator. In BC++ 4.5, the new operator no longer returns NULL in case
  387. of failure, rather the xalloc exception is thrown.  To change this back
  388. so operator new returns NULL, call set_new_handler(0).
  389.  
  390. The only remaining issue is with using the new operator in the
  391. constructor of global objects.  How do you call set_new_handler(0)
  392. before a global object's constructor is called?  This is accomplished by
  393. using a #pragma startup function with a priority higher than that of the
  394. startup function used to call the particular global object's
  395. constructor.  The following code shows an example of changing the
  396. behavior of new:
  397.  
  398.    #include <new.h>
  399.  
  400.    void old_new(void)
  401.    {
  402.       set_new_handler(0);
  403.    }
  404.  
  405.    #pragma startup old_new 31
  406.  
  407.    BEngine eng(pxWin);
  408.  
  409.    int main (void)
  410.    {
  411.    .
  412.    .
  413.    .
  414.       return 0;
  415.    }
  416.  
  417. Note that creating global instances of Database Framework objects is not
  418. recommended because it can make error checking difficult.
  419.  
  420. The other option is to change the source of the Database Frameworks: Add
  421. the try {} catch(xalloc) clause everywhere that new is called.
  422.  
  423.  
  424.