README.TXT
上传用户:hongxing
上传日期:2013-09-06
资源大小:31732k
文件大小:45k
源码类别:

uCOS

开发平台:

C/C++

  1.                    Welcome to Borland C++ 4.0
  2.                    --------------------------
  3.   This README file contains important information about Borland C++.
  4.   For the latest information about Borland C++ and its accompanying
  5.   programs and manuals, read this entire file.
  6. -----------------
  7. TABLE OF CONTENTS
  8. -----------------
  9. 1.  How to Get Help
  10. 2.  Installation
  11. 3.  Features
  12.      -Compiler
  13.      -Linker
  14.      -IDE
  15.      -Turbo Debugger
  16.      -Resource Workshop
  17.      -ObjectWindows Library (OWL)
  18.      -VBX Support
  19.      -Documentation
  20. 4.  Important Information
  21.      -General
  22.      -New Tools
  23.      -Running from a Windows 3.1 DOS Prompt
  24.      -C/C++ Language Changes
  25.      -Developing for NT
  26.      -Libraries and Startup Code
  27.      -New Compiler and Linker Switches
  28.      -Converting Your Borland C++ 3.1 Windows Code to Borland C++ 4.0
  29.      -Class Libraries
  30.      -Casting Macros
  31.      -IDE/Integrated Debugging
  32.      -Floating Point Formats
  33.      -Turbo Debugger for Windows
  34.      -Using Tools with NTFS
  35. ------------------
  36. 1. HOW TO GET HELP
  37. ------------------
  38.   If you have any problems, please read this file, the
  39.   HELPME!.DOC and other files in your DOC subdirectory, and
  40.   check the on-line help and the Borland C++ manuals first.
  41.   If you still have a question and need assistance, help is
  42.   available from the following sources:
  43.   1. For instant on-line access to the Borland forums with
  44.      their libraries of technical information and answers
  45.      to common questions, type
  46.         GO BCPPDOS     - for questions pertaining to DOS
  47.          or
  48.         GO BCPPWIN     - for questions pertaining to Windows
  49.      If you are not a member of CompuServe, see the enclosed
  50.      special offer, and write for full details on how to receive
  51.      a free IntroPak containing a $15 credit toward your first
  52.      month's on-line charges.
  53.   2. Borland offers a wide variety of Technical Support plans
  54.      providing a range of assistance from installation and general
  55.      usage of Borland C++ to language syntax, programming, and
  56.      debugging help. For information about these support programs,
  57.      call 1-800-523-7070.
  58.   3. Borland's TECHFAX service. Call (800) 822-4269 for a FAX
  59.       catalog of technical document entries.
  60.   4. Borland DLBBS. Dial (408) 431-5096 (up to 9600 baud, 8-N-1)
  61.       for a host of free technical documents and example programs.
  62.   5. For immediate assistance with everything from configuring Borland C++
  63.       to programming or debugging, call our C++ Programmer's
  64.       Advisor Lines ($2/minute, first minute free):
  65.             * Windows / Win32: 1-900-555-1002  or 1-800-782-5558 (MC/Visa)
  66.             * DOS : 1-900-555-1004  or 1-800-368-3366 (MC/Visa)
  67. ---------------
  68. 2. INSTALLATION
  69. ---------------
  70. Important!
  71. ----------
  72. Do not install Borland C++ 4.0 files over previously installed Borland
  73. C++ directories. The files in this distribution will not work
  74. with previously shipped tools and libraries.  This is particularly
  75. true for configuration files from previous shipping
  76. releases, like TDCONFIG.TDW and BCCONFIG.BCW.
  77. Also, be especially careful when using object files and libraries
  78. from Borland C++ 3.1 with binaries created with this release. There are 
  79. several potential problems when linking with old objects or libraries. 
  80. Exceptions won't work correctly (destructors won't get called) when a 
  81. pre-BC4 stack frame is unwound due to an exception. Also, if a constructor 
  82. or destructor compiled with a pre-BC4 compiler is involved in exception 
  83. unwinding, trouble may occur. Another potential problem is when an RTTI class 
  84. is shared with pre-BC4 code; some cases of that will be caught by the linker,
  85. but others may fail mysteriously. Try using the -K2 switch to get pre-BC4 code
  86. to link. Note: these problems are C++ specific. C objects between versions
  87. should be more readily compatible.
  88. Installing Borland C++ 4.0 on your hard disk:
  89. --------------------------------------
  90. Installing from floppy disks:
  91. 1. Select File|Run from Windows 3.1, Windows for Workgroups 3.1x,
  92.    or Windows NT.
  93. 2. Enter A:INSTALL (or B:INSTALL) on the input line.
  94. 3. Under "Installation Options", you have the option of not
  95.    installing Win32s, which should be turned off if you are 
  96.    installing under Windows NT.
  97.           (NOTE that BCW does not run under NT, so if you are only using
  98.           NT, you may wish to not install it.)
  99. 4. Fill in directories as appropriate, and INSTALL will create
  100.           appropriate Windows groups, install Win32s, and install the
  101.    new Borland C++ 4.0 software according to the directories you select.
  102. Installing from the CDROM:
  103. 1. Go to the CDROM, and change directories to INSTALL.
  104. 2. Select File|Run from Windows 3.1, Windows for Workgroups 3.1x,
  105.    or Windows NT.
  106. 3. Enter X:INSTALL on the input line (where X: is your CDROM drive).
  107. 4. Under "Installation Options", you have the option of not
  108.    installing Win32s, which should be turned off if you are
  109.    installing under Windows NT.
  110. 5. Fill in directories as appropriate, and INSTALL will create
  111.    appropriate Windows groups, install Win32s, and install the
  112.    new Borland C++ 4.0 software according to the directories you select.
  113. To use the built-in transfer tools and Help, make sure their location is
  114. in your path (the BIN directory for Borland C++ 4.0).
  115. After installing, make sure your path is set correctly, and restart 
  116. Windows before using Borland C++ 4.0.
  117. NOTE: If you want to install the Win32s debug kernel, use the
  118. SWITCH.BAT file provided with the Microsoft Win32s tools, found on the
  119. NT SDK CD-ROM distribution.  This will ensure that the proper files
  120. are copied to the appropriate places.  Not copying the files correctly 
  121. will result in obscure load errors. 
  122. Configuring Borland Pascal and Borland C++
  123. ------------------------------------------
  124. The install program for Borland C++ 4.0 will configure your system to
  125. allow the use of Borland C++ 4.0 and Borland Pascal 7.0 on the same
  126. machine.  As long as you have installed Borland Pascal prior to
  127. (rather than after) installing Borland C++ there are very few
  128. guidelines you must follow:
  129. - The two Windows hosted IDEs may not be run simultaneously.
  130. - Each must use their respective copies of tools and utilities that
  131.   depend on debug information, most notably Turbo Debugger for Windows
  132.   (TDW).  You may find it useful to rename the Borland Pascal version
  133.   of TDW.EXE to something like BPTDW.EXE to avoid confusing filenames
  134.   in your path.
  135. - Both versions of TDW may not be run simultaneously.
  136. - Make sure that old copies of TDW.INI are removed from your system. 
  137.   (Running the utility TDWINI.EXE will make sure that this takes
  138.   place.)
  139. That's all there is to it!  To reduce disk space requirements, you
  140. may wish to remove duplicate versions of utilities that do not
  141. require debug information, such as WinSight and Resource Workshop. 
  142. In these cases, you will want to use the versions that came with
  143. Borland C++ 4.0 so that you will have the latest features.
  144. If you wish to use TDWGUI.DLL with TDW version 3.1 you need to
  145. manually add UseTimer=Yes to the VideoOptions section of TDW.INI. 
  146. Note that this option should not be set when using TDW version 4.0. 
  147. This means that you would need to hand change your TDW.INI file each
  148. time you switched between versions of TDW.  For this reason, we
  149. recommend the non-windowed video DLLs (such as SVGA.DLL) for
  150. customers who debug both BP and BC applications.
  151. If you are installing Borland Pascal 7.0 AFTER Borland C++ 4.0 has
  152. been installed, you will have to manually change the system settings
  153. that allow these products to coexist:
  154. In your system.ini file, check your [386Enh] section for multiple
  155. entries for the device TDDEBUG.386.  Remove duplicate entries of
  156. TDDEBUG.386 so that only the version from Borland C++ is loaded.  On
  157. disk, you may also want to rename or remove the BP7 versions of
  158. TDDEBUG.386 and TDWIN.DLL to avoid their accidental loading.  You
  159. must restart Windows after making changes to system.ini.
  160. Win32s and minimum swap file size
  161. ---------------------------------
  162. Borland recommends that you have a minimum of 12 MB of memory available to
  163. run Win32s applications.  For example, if your machine has 8 MB of memory
  164. available to Windows, you should configure your "Virtual Memory" (swapfile)
  165. to at least 4 MB.  This will reduce the risk of out-of-memory errors 
  166. occuring in Win32s.
  167. NT console applications and Win32s
  168. ----------------------------------
  169. There is no Win32s console, so attempting to run a Win32 console
  170. application without NT loaded will result in an error.
  171. Changes to SYSTEM.INI file
  172. --------------------------
  173. The install program makes these changes to the SYSTEM.INI file:
  174.   1) Adds "device=c:bc4binwindpmi.386" to support our 32-bit tools.
  175.   2) Adds "device=c:bc4bintddebug.386" to support our debugger.
  176. Configuring the Windows NT command prompt
  177. -----------------------------------------
  178. To run 16-bit protected-mode programs (bcc, tlink) under an NT command prompt
  179. you need to add the following line to CONFIG.NT:
  180.   ntcmdprompt
  181. Under the default NT command-line prompt, DOS COMMAND.COM is run after
  182. returning from a TSR (such as RTM.EXE which bcc and tlink load). Adding the 
  183. above line will cause the original NT CMD.EXE to be run.
  184. Outdated versions of Win32s
  185. ---------------------------
  186. If you are running an outdated version of Win32s, the INSTALL program will
  187. instruct you to remove it before installation.  To remove an old
  188. version of Win32s perform the following steps:
  189.   1. Change directory to the WINDOWS directory on your hard drive.  This
  190.      is most likely C:WINDOWS.
  191.   2. Edit the SYSTEM.INI file and remove the line in the [386Enh]
  192.      section that reads:
  193.        device=C:WINDOWSSYSTEMWIN32SW32S.386
  194.      (The actual path in the above line may be different to reflect your
  195.       configuration.)
  196.   3. Change directory to the SYSTEM subdirectory.
  197.   4. Remove the following files:
  198.        W32SYS.DLL
  199.        WIN32S.INI
  200.        WIN32S16.DLL
  201.   5. Change directory to the WIN32S subdirectory.
  202.   6. Remove all files here.
  203.   7. Change directory back to SYSTEM and remove the WIN32S subdirectory.
  204. You will now be ready to run the INSTALL program.  Be sure to select
  205. <Install Win32s> in the INSTALL program so that the newer version of Win32s
  206. will be installed on your system.
  207. -----------
  208. 3. FEATURES
  209. -----------
  210. Compiler:
  211. ---------
  212.   - Support for writing 16 and 32-bit Windows applications that target
  213.     Windows 3.1, Win32s and Windows NT, and 16-bit DOS applications.
  214.   - Pentium support.
  215.   - Support for ANSI C++ exception handling, structured exception handling
  216.     under C, and mixed C/C++ exception handling. All exception handling
  217.     constructs are available for both 16- and 32-bit.
  218.   - Additional optimizations and faster compile time.
  219.   - Support for ANSI C++ operator new[] and operator delete[].
  220.   - Runtime Library support for the ANSI C++ string class.
  221.   - Support for ANSI C++ runtime type identification (RTTI).
  222.   - Support for ANSI C++ new style casts dynamic_cast, static_cast, const_cast,
  223.     and  reinterpret_cast.
  224.   - Support for three character types as provided in ANSI C++.
  225. Linker (16-bit and 32-bit):
  226. ---------------------------
  227.   - Now handles binding of resources; no need for a separate RC or
  228.     RLINK step.
  229.   - Linker debug capacity expanded.
  230. IDE
  231. ---
  232.   - 16-bit DOS and Windows plus 32-bit Windows targeting from a single IDE.
  233.   - Integrated GUI debugging for 16-bit Windows applications.
  234.   - Includes both 16- and 32-bit tools (compiler, linker, resource 
  235.     compiler, resource binder, and library manager)  
  236.   - A new project manager that supports multiple targets, drag-and-drop,
  237.     and Style Sheets for associating options. 
  238.   - AppExpert, which simplifies the process of creating
  239.     ObjectWindows applications through code generation.
  240.   - ClassExpert, which simplifies adding and managing classes in
  241.     your AppExpert application.
  242.   - Transfers, Settings Notebook, SpeedMenus, and a configurable SpeedBar.
  243.   - Expanded editor support, including column blocking and window 
  244.     splitting.  TEMC now called KEYMAPR.
  245.   
  246. Turbo Debugger:
  247. ---------------
  248.   - Turbo Debugger (TD32) for Win32s and Windows NT.
  249.   - Support for OS exception handling.
  250.   - Support C/C++ exception handling.
  251.   - Windows NT thread support.
  252.   - Video DLL to run TDW in a window.
  253.   - Remote debugging with TDW.
  254.   - Session state saving.
  255.   - Process attach for Windows NT.
  256.   - Turbo Debugger Video Configuration Utility (TDWINI.EXE). 
  257.   - Built in large model for greater capacity.
  258. Resource Workshop:
  259. ------------------
  260.   - Support for Win32s, Win32.
  261.   - Resource preview
  262.   - DialogExpert
  263.   - Auto ID numbering
  264.   - Auto mapping of accelerators and help hints to menu items
  265.   - Support for VBX controls
  266.   - SpeedMenus
  267.   - Dialog editor property inspector
  268.   - Integrated with ClassExpert and IDE project manager
  269. ObjectWindows Library (OWL)
  270. ---------------------------
  271.   - Complete coverage of Windows API, including GDI
  272.   - Single source for Win 3.1, Win 32s, and NT
  273.   - Built in exception handling using standard C++ exceptions for robust error
  274.     handling
  275.   - Built-in type safety using standard C++ templates
  276.   - Toolbars, status lines, and print preview
  277.   - Flexible Document/View architecture
  278.   - Supports VBX 1.0 controls in a dialog or window
  279.   - Layout Windows
  280.   - Mix-in architecture
  281.   - Support for 3d controls
  282.   - Support for BWCC controls
  283.   - Gadgets and Widgets
  284.   - Multi threading support
  285.   - Printing and print previewing support
  286. VBX Support
  287. -----------
  288. Borland's visual tools, such as Resource Workshop, provide support of VBX 1.0
  289. controls via a DLL called BIVBX10.DLL. You can freely distrubute this DLL
  290. with programs you create that use VBX controls.
  291. BIVBX10.DLL has been tested with a large number of VBX controls written to the
  292. Microsoft Visual Basic 1.0 CDK specification. If you have a problem with a
  293. specific control, make sure that it does not require VB 2.0 or VB 3.0 CDK
  294. functionality. VBX 2.0 and 3.0 controls will usually display a message saying
  295. that they require VB 2.0 or 3.0 support. In some cases, though, the control may
  296. appear to work but exhibit instability. Please contact the control vendor and
  297. explain the problem. They may have an updated control or may be able to contact
  298. Borland to find a solution.
  299. Documentation:
  300. --------------
  301. This distribution includes printed and online documentation
  302. to help you understand and use the new features of Borland C++ 4.0, as well
  303. as online Help.  
  304. For C++ Language and Programming information:
  305. See the Library Reference, the
  306. Programmer's Guide, and the DOS Reference.
  307. See also the online Help.
  308. For information on using MAKE, TLINK, and resource tools:
  309. See the User's Guide.
  310. See also the online Help.
  311. For information on keyboard mapping and KEYMAPR (used to be called TEMC):
  312. See the online Help.
  313. For information on using the IDE, AppExpert & ClassExpert, the Integrated
  314. Debugger, and compiling options:
  315. See the User's Guide.
  316. See also the online Help.
  317. For information on using the new Project Manager:
  318. See the online Help.
  319. For information on converting your ObjectWindows 1.0 code to 
  320. ObjectWindows 2.0:
  321. See the ObjectWindows Programmer's Guide.
  322. See also the online text file owldoc.wri.
  323. For information on programming in ObjectWindows 2.0: 
  324. See the ObjectWindows Reference Guide, and the
  325.   ObjectWindows Programmer's Guide.
  326. See also the online text file, owldoc.wri.
  327. For help using Turbo Debugger:
  328. See the online text files helpme!.tdw and hints.tdw.
  329.        See also the online Help.
  330. To use the online Help, make sure the Borland C++ 4.0 BIN directory is
  331. on your path.
  332. ------------------------
  333. 4. IMPORTANT INFORMATION
  334. ------------------------
  335. GENERAL
  336. -------
  337. Note that if you have only 8 MB of RAM, you might experience some out-of-memory
  338. problems building and using 32-bit applications. Please see the section below
  339. titled, "Out of memory and MAKESWAP".
  340. Object File Format
  341. ------------------
  342. This product is designed to use and generate only object files which adhere
  343. to the Intel OMF (Object Module Format) specification. This means that TLINK32
  344. and TLIB only accept files of this format, and all provided libraries use 
  345. this format. There is no support in the linker or librarian for COFF object
  346. modules produced by Microsoft C tools.
  347. MAKE 
  348. ----
  349. MAKE will not put a space between two sets of file list macros as in BC++ 3.1
  350. and before.  The example makefile below illustrates this; simply execute MAKE
  351. in the directory containing the makefile. The output is:
  352.    ALLOBJS1 = one onetwo two
  353.    ALLOBJS2 = one one two two
  354. makefile:
  355. OBJS1 = 
  356.    one 
  357.    one
  358. OBJS2 = 
  359.    two 
  360.    two
  361. ALLOBJS1 = $(OBJS1)$(OBJS2)
  362. ALLOBJS2 = $(OBJS1) $(OBJS2)
  363. ..:
  364.    @@echo ALLOBJS1 = $(ALLOBJS1)
  365.    @@echo ALLOBJS2 = $(ALLOBJS2)
  366. Out of Memory and MAKESWAP
  367. --------------------------
  368. If you get "Out of Memory" errors from DOS when running the
  369. command-line tools, create a swap file with the MAKESWAP utility.
  370. (Note that this applies to DOS only, not to DOS boxes opened under
  371. Windows.) MAKESWAP takes the size of the file to create in KBytes,
  372. for example:
  373.   MAKESWAP 12000
  374. will create a 12MB swap file in the current directory called EDPMI.SWP
  375. for use by Borland command line tools.  To enable the swap file, use
  376. the DPMI32 environment variable by issuing the following command at
  377. the DOS prompt:
  378.   set DPMI32=SWAPFILE <location of swap file>EDPMI.SWP
  379. Note that you must clear this environment variable by issuing the
  380. command
  381.   set DPMI32=
  382. before running Paradox or other 16-bit DPMI-hosted executables,
  383. such as Borland C++ 3.1 command-line tools.
  384. Threads
  385. -------
  386. When creating secondary threads, the _beginthread or _beginthreadNT and
  387. _endthread() RTL functions must be used to ensure the proper RTL
  388. initialization and cleanup. Using NT's CreateThread and ExitThread functions
  389. will result in undefined behavior if an implicit or explicit call is made to
  390. the RTL. Note that using exception handling and/or RTTI can lead to implicit
  391. RTL calls.
  392. DDVT functions and RTTI
  393. -----------------------
  394. When compiling code that contains DDVT functions, do not use run-time type
  395. information. If you attempt this, you will receive an error message. In order
  396. to compile without using run-time type information, compile all code that
  397. uses DDVTs (for instance OWL 1.0x libraries and applications) with the
  398. -RT- switch (Options|Project|C++ Options|Exception handlingRTTI in the IDE).
  399. Inline assembly and interrupts
  400. ------------------------------
  401. If your inline assembly code includes an interrupt call, the compiler does not
  402. preserve any registers altered by the call. You must write code to save and
  403. restore registers when using interrupt calls within inline assembly code.
  404. Obsolete Win32 functions
  405. ------------------------
  406. To discover when a function (such as DOS3Call) is obsolete under Win32, click
  407. on the hypertext link for "Win32 version" in Online Help. This leads to a new
  408. screen explaining that you can't use this function in Win32. When a
  409. function works differently in the two versions, a link appears on the
  410. first screen enabling the user to jump directly to help for the Win32
  411. version of the function.
  412. BC4 path name
  413. ------------------
  414. Any occurrence of BORLANDC in the BC++ 4.0 path should be replaced with BC4.
  415. Creating 16-bit import libraries from .DEF files
  416. ------------------------------------------------
  417. Use the /o implib switch when creating 16-bit import libraries from .DEF files
  418. to prevent implib from generating extensions for import entry module names.
  419. Debugging DDE applications
  420. --------------------------
  421. DDE applications must be debugged in hard mode.
  422. ----------
  423. New Tools
  424. ----------
  425. The 16-bit linker has been modified in this version to allow for more than 64K
  426. symbols in the executable's symbol table. The following tools have changed to
  427. conform to the resulting new debug information format:
  428.   TDW
  429.   TDUMP
  430.   Turbo Debugger (standalone)
  431.   IDE Debugger
  432.   IDE Browser
  433. These tools have versioning information, so that if you attempt to use any of
  434. them with executables created in prior versions, an error message will result.
  435. You will then need to relink your executables.
  436. If you don't see correct dump information when using TDUMP version 4.1 on your
  437. executables, check the header at the top of the output. If it does not indicate
  438. version 4.0 debug information, the associated .EXE file must be recompiled with
  439. version 4.0 tools.
  440. -------------------------------------
  441. Running from a Windows 3.1 DOS Prompt
  442. -------------------------------------
  443. If you run BCC or TLINK from a Windows DOS box and you get
  444. out of memory errors, increase the XMS memory (in the 'Maximum'
  445. setting) allocated for the DOS box by editing the appropriate .PIF
  446. file (usually DOSPRMPT.PIF). BCC.EXE needs about 4MB to compile
  447. medium-sized .CPP files, and might need more memory for large .CPP
  448. files with debugging information.
  449. NOTE: You must set the 'Maximum:' setting to the amount needed, not
  450.       the 'Required:' setting.  Using the 'Required:' setting only
  451.       sets aside memory for XMS, NOT for DPMI services and hence
  452.       any amount set in the 'Required:' setting box is unavailable.
  453. -------------------
  454. Developing under NT
  455. -------------------
  456. To do development on NT, use the command-line tools, Resource
  457. Workshop, and TD32. Using the IDE under NT is not currently
  458. supported.
  459. ----------------------
  460. C/C++ Language Changes
  461. ----------------------
  462. Many changes were made to the compiler in compliance with the 
  463. latest changes proposed by the ANSI C++ committee.  These include
  464. three distinct char types, enhancements to templates, support for
  465. virtual functions differing in return types, and other improvements
  466. listed here.  See the Library Reference and the Programmer's Guide
  467. for complete details on these changes and how they affect your 
  468. code.
  469. wchar_t is a fundamental data type in C++ programs. In C programs it continues
  470. to be a typedef defined in stddef.h. See online Help.
  471. Enum operator overloading is also supported in this compiler.
  472. The runtime library now supports the ANSI C++ string class.
  473. If you already have a string class, it must be renamed for Borland C++ 4.0.
  474. In addition, operator new and operator new[] now throw an
  475. exception (xalloc), as specified by the ANSI C++ committee.
  476. To get the old behavior, you can issue set_new_handler(0). (Note,
  477. however, that set_new_handler(0) does not work with ObjectWindows
  478. or string classes.) See Chapter 3 of the Programmer's Guide.
  479. Note that arrays are now being allocated through operator new[]()
  480. and deleted by operator delete[](). An example is provided in 
  481. Chapter 3 of the Programmer's Guide.
  482. Borland C++ 4.0 implements ANSI C++ runtime type identification (RTTI). See
  483. the Library Reference, "C++ runtime support",  for a description of
  484. class Type_info. RTTI and operator typeid() are fully described in
  485. Chapter 3 of the Programmer's Guide.
  486. Borland C++ 4.0 provides a full implementation of exception handling
  487. under C++ and C.  C exceptions can be handled in C or C++ code;
  488. C++ exceptions can be handled only in C++ code. The C++ exceptions are
  489. described in the Library Reference, "C++ run-time support." See Chapter 4
  490. of the Programmer's Guide for a full description of how to use exception
  491. handling.
  492. Borland C++ 4.0 also implements the accepted ANSI C++ new style casts. See the
  493. Chapter 3 of the Programmer's Guide for information and examples.
  494. --------------------------
  495. Libraries and Startup Code
  496. --------------------------
  497. The contents of the LIB directory are described in the online Help.
  498. See the DOS Reference for a description of DOS-only libraries and
  499. start-up code.
  500. There are two new functions that provide access to 32-bit operating system
  501. file handles. See online Help for a description of _open_osfhandle and
  502. _get_osfhandle.
  503. Member function Type_info::fname() is not available.
  504. Several global variables and library functions have been renamed. See the
  505. Library Reference, Chapter 1.
  506. ----------------------------------
  507. Compiler and Linker Switch Changes
  508. ----------------------------------
  509. See the User's Guide for information on new compiler and linker switches.
  510. You may get this 32-bit Linker warning:
  511. Warning: External symbol <XX> was not qualified with __import in 
  512.        module <YY>
  513. If the symbol <XX> is a function, you can ignore this warning.  If
  514. the symbol <XX> is data, then you must qualify the symbol with __import.
  515. BCC32 provides support for the Pentium processor. This support is enabled
  516. by the -5 compiler switch.
  517. -----------------------------------------------------------------------
  518. Converting Your Borland C++ Version 3.1 Windows Code to Borland C++ 4.0
  519. -----------------------------------------------------------------------
  520. To get your BC++ 3.1 code to compile and run successfully under Borland C++ 4.0,
  521. you can modify your code to reflect three character types where compiler
  522. errors occur when using the Borland C++ 4.0 RTL includes. Otherwise, you can
  523. use the -K2 compiler option with the RTL includes from BC++ 3.1. This option
  524. provides for only two character types. (Note that -K2, a backward 
  525. compatibility switch, is supported only in the 16-bit compiler.) 
  526. Also, use operator new[]() and delete[]() syntax for class arrays.
  527. Note that certain 32-bit to 8-bit conversions allowed by ANSI are flagged 
  528. by BCC32 with "Conversion may lose significant digits in function XXXXX".
  529. You can safely ignore this message if you are doing certain types of 32-bit
  530. to 8-bit casts (for instance, int to char) and you're not worried about
  531. losing significant digits in those cases.
  532. ------------------------------
  533. Changes to the Class Libraries
  534. ------------------------------
  535. Only the version of the class library implemented with C++ templates 
  536. is distributed and directly supported in Borland C++ 4.0.
  537. The class library "object-based" include files are provided in the
  538. BC4INCLUDECLASSLIBOBSOLETE subdirectory.  The object-based
  539. libraries themselves are not supplied, but can be built using the
  540. instructions found in the BC4SOURCECLASSLIB makefile (see the
  541. comments located there).
  542. TSArray and TSArrayIterator classes have been added to the class libraries.
  543. They are aliases for TSArrayAsVector and TSArrayAsVectorIterator.
  544. The Flush and Delete member functions for direct containers (except
  545. dictionaries) no longer take a delete parameter (this parameter had been
  546. ignored since direct containers have their own copy of the contained element).
  547. For example:
  548.   TMArrayAsVector<double> arr(10);
  549.   arr.Flush(); // legal
  550.   arr.Flush(1); // illegal - causes syntax error
  551.   arr.Detach(index); // legal
  552.   arr.Detach(index,1); // illegal - causes syntax error
  553.   TMIArrayAsVector<double> arr1(10);
  554.   arr1.Flush(); // legal
  555.   arr1.Flush(1); // legal.
  556.   arr1.Detach(index); // legal
  557.   arr1.Detach(index,1); // legal
  558. Bag and set container member function FindMember is now called Find.
  559. It takes the same parameters.
  560. Association containers now have a member function called DeleteElements:
  561.   void DeleteElements()
  562. The dictionary containing the associations determines whether pointed-to
  563. objects should be deleted, and, if so, calls DeleteElements for each of
  564. the associations it holds. The Detach and Flush member functions for the
  565. TMDictionaryAsHashTable template (and all templates derived from it)
  566. have been changed to the following:
  567.   int Detach( const T &t, DeleteType dt = DefDelete )
  568.   void Flush( DeleteType dt = DefDelete )
  569. These changes to the direct versions of the dictionary templates makes them
  570. similar to an indirect container in how they handle object ownership. Here is
  571. an example:
  572.   TDIAssociation<int,int> assoc( 3, new int(4) ); //create an association
  573.   TDictionaryAsHashTable<int,int> dict; //creates a dictionary
  574.   dict.Add( assoc ); //copies assoc into the dictionary
  575.   dict.OwnsElements(); //tell dict that it should delete pointed-to objects
  576.   dict.Flush(); //deletes the int created by new in the first line.
  577. All list and double-list containers now have the DetachAtHead member function.
  578. This function removes items from the head of a list without searching for a
  579. match. The syntax is
  580.   int DetachAtHead() // for direct lists
  581.   int DetachAtHead( int del = 0 ) //for indirect lists
  582. Example:
  583.   TMListImp<MyObject>list; //create list to hold MyObjects
  584.   list.Add(MyObject()); //construct a MyObject, add to list
  585.   list.Add(MyObject()); //add second MyObject
  586.   list.DetachAtHead(); //remove MyObject at head of list
  587. Changes to class diagnostics
  588. ----------------------------
  589. Previously, in order to create a diagnostic group you had to declare it
  590. and define it in the same file:
  591.   DIAG_DECLARE_GROUP( Sample );
  592.   DIAG_DEFINE_GROUP( Sample, 1, 0 );
  593. We also provided a macro that did both of these together:
  594.   DIAG_CREATE_GROUP( Sample, 1, 0 );
  595. A change in the diagnostic software makes it illegal to have both
  596. DECLARE and DEFINE in the same file. So code that creates a diagnostic
  597. group now does it in one step:
  598.   DIAG_DEFINE_GROUP( Sample, 1, 0 );
  599. DIAG_CREATE_GROUP has been removed. DIAG_DECLARE_GROUP still creates an
  600. extern declaration for a diagnostic group (see file CHECKS.H and CHECKS.CPP).
  601. Code that uses both DIAG_DECLARE_GROUP and DIAG_DEFINE_GROUP in the same
  602. file must be changed to remove DIAG_DECLARE_GROUP.
  603. Old code:
  604.   DIAG_DECLARE_GROUP( Sample );
  605.   DIAG_DEFINE_GROUP( Sample, 1, 0 );
  606. New code:
  607.   DIAG_DEFINE_GROUP( Sample, 1, 0 );
  608. Any use of DIAG_CREATE_GROUP must be changed to DIAG_DEFINE_GROUP.
  609. Old code:
  610.   DIAG_CREATE_GROUP( Sample, 1, 0);
  611. New code:
  612.   DIAG_DEFINE_GROUP( Sample, 1, 0 );
  613. Also if a header file uses DIAG_DECLARE_GROUP (so that the group declaration is
  614. automatically available to files that #include the header), the source file
  615. that contains the DIAG_DEFINE_GROUP invocation for that group will generate
  616. a redefinition error (this isn't done anywhere in OWL or class lib). The
  617. solution here to conditionalize the header file so that the declaration goes
  618. away when the source file with the DIAG_DEFINE_GROUP invocation is built:
  619. foo.h
  620. -------
  621. #if !defined( BUILD_FOO_GROUP )
  622. DIAG_DECLARE_GROUP( Foo );
  623. #endif
  624. foo.cpp
  625. -----------
  626. #define BUILD_FOO_GROUP
  627. #include "foo.h"
  628. Changes to Object Streaming
  629. ---------------------------
  630. The implementation of Object Streaming formerly used in ObjectWindows and
  631. Turbo Vision has been moved into the class library. There have been several
  632. changes made to the streaming mechanism, but they should be transparent to
  633. existing class library code.  See the Programmer's Guide for details on 
  634. streaming.
  635. The header file OBJSTRM.H defines several macros that will make creating
  636. streamable objects easier. See that header file for further documentation.
  637. There are two types of streamable objects:
  638.  - Resident objects which may be streamed out but which are not reconstructed
  639.    when streamed back in
  640.  - Dynamic objects which are reconstructed when streamed in.
  641. Resident objects include static objects and objects present when an
  642. application starts, such as its main window. These objects must be streamed
  643. out via a reference rather than via a pointer.
  644. Dynamic objects, on the other hand, must be streamed out via pointers,
  645. causing them to be reconstructed when streamed back in.
  646. Resident objects must be streamed out before any objects which stream out
  647. pointers to the resident objects, else duplicate objects will be constructed
  648. when streaming in.
  649. When streaming objects in, Streamer::Read must insure that all data fields
  650. are initialized, because the streaming constructor doesn't initialize any of
  651. the data fields. Any data members not streamed in must be set to meaningful
  652. values. Care must be taken to initialize the members before streaming in base
  653. class data or pointers to objects which have pointers back to the current
  654. object. Virtual functions are enabled in Streamer::Read.
  655. Changes to the string class
  656. ---------------------------
  657. The following sections correct string class member function definitions.
  658.   size_t find_first_of( const string _FAR &s ) const
  659. Locates the first occurrence in the target string of any character contained
  660. in string s. If the search is successful find_first_of returns the character
  661. location. If the search fails it returns NPOS.
  662.   size_t find_first_of( const string _FAR &s, size_t pos ) const
  663. Locates the first occurrence in the target string of any character contained
  664. in string s after position pos. If the search is successful, it returns the
  665. character position within the target string. If the search fails or if
  666. pos > length(), it returns NPOS.
  667.   size_t find_first_not_of( const string _FAR &s) const
  668. Locates the first occurrence in the target string of any character not
  669. contained in string s. If the search is successful, find_first_not_of returns
  670. the character position within the target string. If the search fails it
  671. returns NPOS.
  672.   size_t find_first_not_of( const string _FAR &s, size_t pos ) const
  673. Locates the first occurrence in the target string of any character not
  674. contained in string s after position pos. If the search is successful
  675. find_first_not_of returns the character position within the target string.
  676. If the search fails or if pos > length(), find_first_not_of returns NPOS.
  677.   size_t find_last_of( const string _FAR &s ) const
  678. Locates the last occurrence in the target string of any character contained in
  679. string s. If the search is successful find_last_of returns the character
  680. position within the target string. If the search fails it returns 0.
  681.   size_t find_last_of( const string _FAR &s, size_t pos ) const
  682. Locates the last occurrence in the target string of any character contained in
  683. string s after position pos. If the search is successful find_last_of returns
  684. the character position within the target string. If the search fails or if
  685. pos > length(), find_last_of returns NPOS.
  686.   size_t find_last_not_of( const string _FAR &s ) const
  687. Locates the last occurrence in the target string of any character not
  688. contained in string s. If the search is successful find_last_not_of returns
  689. the character position within the target string. If the search fails it
  690. returns NPOS.
  691.   size_t find_last_not_of( const string _FAR &s, size_t pos ) const
  692. Locates the last occurrence in the target string of any character not
  693. contained in string s after position pos. If the search is successful
  694. find_last_not_of returns the character position within the target string. If
  695. the search fails or if pos > length(), find_last_not_of returns NPOS.
  696. The assign member funtion
  697. assign( const string&, size_t = NPOS );
  698. was changed to
  699. assign( const string&, size_t = 0, size_t = NPOS );
  700. The size_t parameter in the old version was the number of characters
  701. to copy. In the new version that is the second size_t parameter; the
  702. first one is the position in the passed string to start copying.
  703. For example:
  704. string s1 = "abcdef";
  705. string s2;
  706. s2.assign( s1, 2, 3 );
  707. After executing this code, s2 should contain "cde".
  708. The same change was made in several other functions. The following lists the
  709. new form:
  710. string( const string _FAR &, size_t, size_t );
  711. string( const char _FAR *, size_t, size_t );
  712. string( const char __far *, size_t, size_t );
  713. assign( const string _FAR &, size_t, size_t );
  714. append( const string _FAR &, size_t, size_t );
  715. append( const char _FAR *, size_t, size_t );
  716. prepend( const string _FAR&, size_t, size_t );
  717. prepend( const char _FAR*, size_t, size_t );
  718. compare( const string _FAR&, size_t, size_t );
  719. insert( size_t, const string _FAR&, size_t, size_t );
  720. replace( size_t, size_t, const string _FAR&, size_t, size_t );
  721. --------------
  722. Casting Macros
  723. --------------
  724. The following casting macros have been provided, and are defined in
  725. BC4INCLUDECLASSLIBDEFS.H:
  726.   TYPESAFE_DOWNCAST(object,toClass)
  727. Converts the pointer referred to by 'object' into a pointer to an object of
  728. type 'toClass'. Note that the macro parameters to TYPESAFE_DOWNCAST are in the
  729. opposite order from the rest of the macros here. When using a compiler that
  730. supports new style casts and runtime type information this is done with
  731. dynamic_cast<> and will return 0 if the cast cannot be done. When using a
  732. compiler that does not support new-style casts and runtime type information
  733. this is done with fake runtime type information generated by the
  734. IMPLEMENT_CASTABLE macro.
  735.   STATIC_CAST(targetType,object)
  736. Converts the data object referred to by 'object' into the type referred to
  737. by 'targetType'. When using a compiler that supports new style casts, this is
  738. done with static_cast<> and will fail if the cast cannot be done without
  739. runtime type information. When using a compiler that does not support new-style
  740. casts, this is done with an old-style dangerous cast.
  741.   CONST_CAST(targetType,object)
  742. Converts the data object referred to by 'object' into the type referred to
  743. by 'targetType'. When using a compiler that supports new style casts, this
  744. is done with const_cast<> and will fail if the cast changes the type of the 
  745. object in any way other than adding or removing const and volatile qualifiers.
  746. When using a compiler that does not support new-style casts, this is done with
  747. an old-style dangerous cast.
  748.   REINTERPRET_CAST(targetType,object)
  749. Converts the data object referred to by 'object' into the type referred to
  750. by 'targetType'. When using a compiler that supports new style casts, this
  751. is done with reinterpret_cast<>. When using a compiler that does not support
  752. new-style casts, this is done with an old-style dangerous cast.
  753. ------------------------
  754. IDE/Integrated Debugging
  755. ------------------------
  756. Using the IDE under NT is not currently supported.
  757. The default extension for Borland C++ 4.0 project files is IDE. 
  758. Using the Microsoft DBWIN utility interferes with the Event log's
  759. ability to display those same messages. If you wish to see those messages in
  760. the Event log, either quit DBWIN or select Options|No Output in DBWIN.
  761. Project style sheets are inherited from the default project when you select
  762. Project|New. You can set inheritance using the following option in the BCW.INI
  763. file:
  764.    [projects]
  765.    inherit=0
  766. where 0 inherits from the default project, 1 from the previous project,
  767. and 2 from the shipping defaults (which are unchangeable).
  768. The following listing explains some of the more useful BCW.INI settings:
  769. [ToolDir]                ; BCW's default paths
  770. BcInclude=bc4include   ;Default Include path, MPD Directories
  771. BcLib=bc4lib           ;Default Lib path, MPD Directories
  772. [Project]
  773. saveastext=1 ;PDL file with Style Sheets and Modified tools
  774. readastext=1 ;Read Style Sheets and Tools
  775. [IDE]
  776. HelpDir=C:BC4BIN              ;where to find the help files
  777. DefaultDesktopDir=C:BC4BIN   ;where to find bcconfig.bcw,
  778.                                 ;bcwdef.bcw/dsw,*.tok,*.ckb
  779. If you step over or into a throw() call, the application will run until it
  780. reaches a breakpoint or program termination, instead of stopping at the
  781. appropriate catch() function. If you wish to debug catch() functions, you
  782. must set breakpoints within them.
  783. Run to Cursor (F4) will do nothing if the source line you wish to run to is
  784. the same source line that the execution point is on. Thus, using F4 to iterate
  785. through any loop structure will not work. Instead, set a breakpoint on a line
  786. in the loop and use Ctrl-F9 (Debug|Run) to iterate through the loop. Once
  787. finished with the loop, the breakpoint can be removed.
  788. The following combination of events will cause unusual behavior:
  789.   - Placing breakpoints in Windows procedures or OWL event handler which will
  790.     receive WM_KILLFOCUS or WM_WINDOWPOSCHANGED messages.
  791.   - Shifting focus from this application while debugging, directly to the IDE.
  792. When focus is changed from the application being debugged to the IDE, Windows
  793. initiates an intertask SendMessage from the IDE to the application. But the
  794. breakpoint prevents SendMessage from completing, putting Windows into an
  795. unstable state. Many GUI debuggers silently ignore a breakpoint in this
  796. situation. The Borland Integrated Debugger displays a message box warning of
  797. this situation giving you the choice of ignoring the breakpoint and continuing
  798. the application, or aborting the application so you can make further changes to
  799. the code or placement of breakpoints before running again. The best way to
  800. avoid this situation is to not click on the IDE when you have a breakpoint in
  801. the Window procecure or OWL event handler that could stop due to an intertask
  802. SendMessage from the IDE. Instead click on some other application like the
  803. Program Manager. This will still result in the WM_KILLFOCUS and related
  804. messages and the intertask SendMessage, but the initiating task will not be the
  805. IDE and thus completely avoids the Windows instability.
  806. One further note: the first click of the mouse on the IDE immediately initiates
  807. the MessageBox and the click in the OK box is the next mouse event captured, so
  808. interesting visual effects may occur depending on where that first mouse click
  809. occurred. For example, if the first click was in the title bar of the IDE, the
  810. second click (in the MessageBox OK) will result in a move of the IDE Window
  811. from its original location to the location of the OK mouse click. If this
  812. happens, move the IDE back to where you want it.
  813. ----------------------
  814. Floating Point Formats
  815. ----------------------
  816. Floating point formats are a collection of formatting information used to
  817. manipulate floating point numbers in certain runtime library functions such as
  818. scanf() and atof().
  819. This section discusses why you might get the error 
  820. FLOATING POINT FORMATS NOT LINKED : ABNORMAL PROGRAM TERMINATION and tells
  821. you how to resolve it.
  822. There are no current plans to fix this because it is not a bug. The intent
  823. is to avoid linking the floating point formats (about 1K of overhead) when
  824. they are not required.  The tradeoff of this feature is that the programmer
  825. must explicitly request that the floating point formats be linked in for some
  826. programs that manipulate floats in a limited and specific fashion.
  827. Because you can get the error in a number of different ways, check the
  828. following list of potential causes to find out how to resolve the error.
  829. These are listed in order of most common to least common causes.
  830.   1.  CAUSE:  Floating point set to <None>.  You have your
  831.       floating point option set to None when it should be set to
  832.       either Fast or Normal.
  833.       FIX:  Set Floating Point to Fast or Normal.  
  834.   2.  CAUSE:  Either the compiler is overoptimizing, or the
  835.       floating point formats really do need to be linked in because
  836.       your program manipulates floats in a limited and specific
  837.       fashion.  Under certain obscure conditions, the compiler will
  838.       ignore floating point usage in scanf().  (e.g., trying to
  839.       read into a float variable that is part of an array contained
  840.       in a structure.)
  841.       FIX: Add the following to one source module:
  842.               extern _floatconvert;
  843.               #pragma extref _floatconvert
  844.   3.  CAUSE:  Forgetting to put the address operator & on the scanf
  845.       variable expression.  For example,
  846.           float foo;
  847.           scanf("%f", foo);
  848.       FIX:  Change the code so that the & operator is used where it
  849.       is needed.  For example, the above code should be
  850.           float foo;
  851.           scanf("%f", &foo);
  852. --------------------------
  853. Turbo Debugger for Windows
  854. --------------------------
  855. You can use TD32 to debug under Win32s. However, to do so, you must
  856. ensure you use SVGA.DLL or equivalent support in the VideoDLL entry
  857. in the [TurboDebugger] section of TDW.INI.
  858. TD32 can support dual monitor debugging under Win32s. Ensure that
  859. a monochrome adapter is installed in your machine and set the
  860. Mono=yes flag in the [VideoOptions] section of TDW.INI:
  861. [VideoOptions]
  862. MONO=yes
  863. See the online text file called td_help!.txt for more information on
  864. using TD32 and TDW.
  865. ---------------------
  866. Using Tools with NTFS
  867. ---------------------
  868. When using Borland C++ 4.0 tools under NTFS, there are issues to be aware
  869. of related to extension assumptions. If Borland C++ 4.0 tools see an
  870. extension, they assume no default.  Therefore, with "bcc32 test.1.cpp",
  871. BCC32 spawns TLINK32 with "-ap c0x32.obj test.1, test.1, import32 cw32".
  872. As TLINK32 sees an extension on test.1, it makes NO assumptions about
  873. a .obj or .exe extension.  It attempts to look for test.1 (instead of
  874. test.1.obj) and to create test. (instead of test.1.exe).
  875. Embedded blanks in filenames are not currently supported. For instance, under
  876. the Windows NT NTFS file system it is legal to have a file named
  877. "This is an interesting file name.cpp". The response file processing in our
  878. 32-bit tools cannot handle this type of file.
  879. 16-bit tools running on NT cannot use NTFS filenames.