Solved

Adding Delphi Components to C++ Builder

Posted on 1997-04-18
9
878 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

739 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