We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now


Adding Delphi Components to C++ Builder

mheacock asked
Medium Priority
Last Modified: 2013-11-23
Just got C++ Builder...looks great...I'm not defecting though...will be using it to enhance some things...one peeve though...when will Borland get their help files right???

To the question:  I have two components directories: Registration and Source.  The source directory contains all the .PAS files that contain the componets classesa and relevant code.  The Registration directory contains a few .PAS files that contain only the minimum registration calls and the .DCU files of source files.  This all works like a charm in Delphi...I've separated things such, because in the past, during debugging, the integrated debugger had an annoying habit of popping into my component code...seems that a USES looks first for .PAS files then for .DCU files.

Anyhow, when I load up the registration .PAS file in C++ Builder and then go through the normal procedure for installing a component...during the component 'compile' and error pops up saying it cn't find XXX.pas.  So it obviously isn't looking for the .DCU file.  I was thinking I should add it to the project, except that C++ Builder won't give me access to any of the project options (the menu is grayed out).

So...what is the procedure for adding a Delphi-written component to C++ Builder???  Given how I have things set-up above?  I even tried compiling one of the .PAS source files to a .OBJ, but that didn't solve anything (besides I read that the .OBJs have to be in a special format and I'm not sure if Delphi 2 will create a .OBJ the C++ Builder is happy with).

I'm pretty sure this is a question between easy and moderate.  Correct me if I'm wrong and I'll adjust the points.
Watch Question

I don't separate things the way you do, and I've had no trouble installing Delphi components into C++Builder.  Maybe you should try giving C++Builder what it wants, and put all the *.pas files into a single directory just for C++Builder.  It shouldn't take up much space, and will tell you if the file locations are really the problem.


I have...the problem lies when I do integrated debugging...the
IDI debugger always pops into the code for my components.  This is really annoying.  The only way I got it to stop in Delphi 2 was to separate to have the registration .pas files located with the .DCUs of the source files.

So I can install my components into C++ Builder but there are annoying side effects.

Is there a way to convert a .DCU into a C++ Builder compatible .OBJ??

>Is there a way to convert a .DCU into a C++ Builder compatible .OBJ??

I don't think so, but I am looking at the files generated from compiling a Delphi component with C++Builder, and an OBJ file is generated.  You might try removing the source PAS file from the path after the component has successfully been compiled into the component library.  This should prevent the debugger from intruding, while still allowing the component to compile.


I tried that yesterday...it did work.  You should post again as
a question and I will award you points.

As an aside...I now have two registration directories.

      --Registration CBuilder
      --Registration Delphi

When installing the components in CBuilder, CBuilder overwrites (rewrites) the .DCU files, making them incompatible with Delphi.
Delphi complains when you try to install the components after you've installed them with CBuilder.  You may or may not have noticed this.  Therefore it is important to separate  your registration files, as Delphi and CBuilder will do different things to the .DCUs.

Anyhow, all comments will be saved in the database, so simply post a question saying, "See comments above".  I'll give you a B or an A...haven't decided.  But since you were the only one to respond, I'm leaning towards an A.


If yuo don't have the source files in the same location as the .DCUs, like me.  Delphi will try and read the .DCUs as is.  CBuilder rewrites them.  Therefore after an install with CBuilder, the .DCUs are no longer compatible with Delphi.  Thought I'd re-explain, since I think I didn't make myself as clear as I could have above.
See comments above.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts


Adjusted points to 80


I increased the points by 5, so that you'll be on the experts points board.

Thank you.  
I hope you Like CBuilder as much as I think I will.  My first complaint about Delphi was that it used Object Pascal rather than C++, But with CBuilder, we get the best of BOTH worlds.

Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.