Solved

Adding Delphi Components to C++ Builder

Posted on 1997-04-18
9
844 Views
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.
0
Comment
Question by:mheacock
  • 5
  • 4
9 Comments
 
LVL 1

Expert Comment

by:sleach
ID: 1335448
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.
0
 
LVL 3

Author Comment

by:mheacock
ID: 1335449
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??
0
 
LVL 1

Expert Comment

by:sleach
ID: 1335450
>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.


0
 
LVL 3

Author Comment

by:mheacock
ID: 1335451
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.

   Components
      --Registration CBuilder
      --Registration Delphi
      --Sources

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.
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 3

Author Comment

by:mheacock
ID: 1335452
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.
0
 
LVL 1

Accepted Solution

by:
sleach earned 80 total points
ID: 1335453
See comments above.
0
 
LVL 3

Author Comment

by:mheacock
ID: 1335454
Adjusted points to 80
0
 
LVL 3

Author Comment

by:mheacock
ID: 1335455
I increased the points by 5, so that you'll be on the experts points board.
0
 
LVL 1

Expert Comment

by:sleach
ID: 1335456
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.

Steve
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
This video discusses moving either the default database or any database to a new volume.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now