Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

usings Dephi components in CBuilder

Status
Not open for further replies.

hennep

Programmer
Dec 10, 2000
429
I want to use a component written in/for Delphi. I can add it to the list of packages and drag it on a form.
But when I try to compile or save the project it asks for a header file and a lib file.

How can I use Delphi components when I do not have any of these .h and .lib files ?
 
Try looking at the Directories/Conditionals page tab when you select the Project>Options menu. Be sure that you have added the directory at which your component is located in the Include and Library paths edit boxes.
 
It is not a matter of setting the path. The component directory only contains bpl,dcp,dcu,dfm files.

The files are really missing.
 
First, in the unit which contains your Delphi component, add the compiler directive {$ObjExportAll On} and make sure you register the component.
In C++ Builder create a new package. Add to the uses of the package USEUNIT(“YourUnit.pas”);
Build and make the package. The component should now be available in the component pallette of C++ Builder and you can put it onto a form as normal.
When you try to build the project you are using this component with it will probably say “Unable to find header file for component&quot;. What you need to do is go to the .h header file of the .cpp file with the component and add #include <YourUnit.hpp> This .hpp file should have been created automatically when you made the package.

Hope this helps. If anyone knows how to do this the other way around (C++ Builder components in Delphi) could you please let me know.
 
When I use some 3rd party components, when I try to compile it asks to find xxxxxxxx.h. I have to go into the directory the component's files are in and select xxxxxxxx.hpp (as the files are .hpp, and not .h). After initially selecting each header file, I am not asked to do so again for the project.
Is there a way to make the compiler detect the xxxxxxxx.hpp files by default, and not ask me to find xxxxxxxx.h? [pc3]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top