Rik's Treehouse > Babbling in Binary > Tips 'n' Tricks > Borland C++Builder 1

Borland C++Builder 1

Borland C++Builder (BCB) is a programming environment for Microsoft Win32 (9x and NT) platforms. It is very well designed and makes it very easy to build professional-looking applications (see my software library for some applications I have written in BCB. My experience is with BCB version 1.0 so some of this information may not apply to later versions.

  1. Can I use Delphi components in BCB?
  2. Which folder should I save new components to?
  3. Do I need all those big *.il? files?
  4. A little known debugging trick.
  5. Why won't my labels AutoSize?

  1. Can I use Delphi components in BCB?
  2. Posted: April 10, 1999

    Problem: There are a lot more (VCL) components available for Borland Delphi (the Pascal equivalent of BCB) than for BCB. Can I install those components and use them in BCB?

    Solution: Yes, you can...provided they come with source code. BCB cannot install the precompiled *.dcu files but it can handle the original source code *.pas. The procedure for installing them is the same as for C++ components (Component > Install... > Add... > Browse) except you need to change the Files of type to Source file (*.PAS) as shown below.

    Using Delphi components in BCB


  3. Which folder should I save new components to?
  4. Posted: April 10, 1999

    Problem: I have downloaded a new VCL component I want to install. Where should I put the files?

    Solution: It doesn't really matter where you put them except for one consideration: BCB (version 1 at least) has a 128 character limit on it's search path. If you scatter components all over your system you will quickly exceed this limit. I recommend locating all added components in a folder called AddOns off your main BCB program directory (usually C:\Program Files\Borland\CBuilder). Then you can just add the very short $(BCB)\AddOns to your library and include paths.

    If there are just a few files with all the same name, I recommend you just place them in the AddOns folder but if it is a complicated component (such as the excellent RX Library I recommend you create a sub-folder like $(BCB)\AddOns\Rx.


  5. Do I need all those big *.il? files?
  6. Posted: April 10, 1999

    Problem: I want to save some disk space. Can I get rid of those big *.il? files?

    Solution: Yes, you can delete them. They are just temporary files used to speed up the compiling and linking process. BCB will rebuild them if it needs them again later. You can also delete the *.tds file. I think it is just used by the debugger, but again it will be rebuilt if needed. Beyond that, if you're really desperate for space you can also delete the compiled object files *.obj (if you still have the original source code).


  7. A little known debugging trick.
  8. Posted: April 10, 1999

    Problem: Is there an easy way to know what sequence code gets executed in?

    Solution: I just happened across this handy little function today. It is called OutputDebugString() and it appends a line of text to a temporary file called OutDbg1.txt on every call. It is very convenient for checking which lines get executed and in which order (ie. tracking down run-time bugs). The usage is described in the BCB help file but basically you just enter OutputDebugString("text to record"); wherever you want. When the program finishes running BCB will automatically open the file OutDbg1.txt for viewing.


  9. Why won't my labels AutoSize?
  10. Posted: April 10, 1999

    Problem: I am using TLabel components with the AutoSize property set to true and it seems to work at design time but when I run my program on a computer with a different resolution or font size the labels are clipped. How can I fix this?

    Solution: The AutoSize property only seems to work when it is originally set. If you set it at design time it won't resize the component dynamically at run-time. One solution is to simply set it to false at design time and to true at run-time (in FormCreate(), for example). I have a component which will do this automatically for all the labels on a form here.

Top of page
[Rik's Office Hours] [Contact Rik]
Last updated: Fri Apr 30 2004, 1:54pm