On Using C++ code from Delphi [Edit]

Hello,

one of the most frequently requested - but never realized - features for Delphi is the ability to use C++ code. I'd like to know about your needs regarding C++, and how you think about such a feature.

- Is it critical for you to be able to use 3rd-party C++ libraries and C++ classes in Delphi without further changes or additional work?

- Or do you want to use VCL components written in C++ in your Delphi projects?

- Imagine a solution that makes C++ classes visible to Delphi code, with the following restrictions:
  o the C++ code needs to be built with C++Builder,
  o the C++ classes which you want to be visible to Delphi need to derive from TObject, and
  o the public methods and properties only use Delphi-compatible types, i.e. native types such as "int", enumerations, AnsiString/UnicodeString, Set<>, DynamicArray<>, interfaces and other TObject descendants. (Member functions which used C++-specific types simply wouldn't be visible in Delphi.)
  Would such a solution work for you?

  - Could you live with being restricted to building with runtime packages enabled?

  - If some 3rd-party software were able to do this, would you use it in production code? Which factors would determine your answer (price, availability of source code, license agreement, ...)?

--
Moritz

"Hey, it compiles! Ship it!"
0
Moritz
7/12/2010 11:28:13 PM
embarcadero.delphi.non-tech 5933 articles. 1 followers. Follow

5 Replies
1163 Views

Similar Articles

[PageSpeed] 59
Get it on Google Play
Get it on Apple App Store

On Mon, 12 Jul 2010 16:28:13 -0700, Moritz Beutel <> wrote:

>  - If some 3rd-party software were able to do this, would you use it in production code? Which factors would determine your answer (price, availability of source code, license agreement, ...)?

what you conceived Moritz? :)

-- 
Vladimir Ulchenko aka vavan
0
Vladimir
7/13/2010 6:17:47 AM
Moritz Beutel wrote:

> Hello,
> 
> one of the most frequently requested - but never realized - features
> for Delphi is the ability to use C++ code. I'd like to know about
> your needs regarding C++, and how you think about such a feature.
> 
> - Is it critical for you to be able to use 3rd-party C++ libraries
> and C++ classes in Delphi without further changes or additional work?
> 
> - Or do you want to use VCL components written in C++ in your Delphi
> projects?
> 
> - Imagine a solution that makes C++ classes visible to Delphi code,
> with the following restrictions:    o the C++ code needs to be built
> with C++Builder,   o the C++ classes which you want to be visible to
> Delphi need to derive from TObject, and   o the public methods and
> properties only use Delphi-compatible types, i.e. native types such
> as "int", enumerations, AnsiString/UnicodeString, Set<>,
> DynamicArray<>, interfaces and other TObject descendants. (Member
> functions which used C++-specific types simply wouldn't be visible in
> Delphi.)   Would such a solution work for you?
> 
>   - Could you live with being restricted to building with runtime
> packages enabled?
> 
>   - If some 3rd-party software were able to do this, would you use it
> in production code? Which factors would determine your answer (price,
> availability of source code, license agreement, ...)?



1: No

2: Who knows if some great C++ library is available

3: that works

4: Hell no ... that enables the DLL hell all over again

5: Don't see why not



Building with runtime packages .... all you want, but I always try to
avoid that one, cause the DLL hell will start !
0
Kristof
7/13/2010 11:38:35 AM
Am 13.07.2010 01:28, schrieb Moritz Beutel:
> Hello,
>
> one of the most frequently requested - but never realized - features for Delphi is the ability to use C++ code. I'd like to know about your needs regarding C++, and how you think about such a feature.
by who?

Actually my experience is that for professional components either a 
standard dll interface exists or at least com objects are available.
AFAIK c++ dll's aren't even quite compatible within c++ (e.g. different
version or compilers...).

kind regards
    Mike
0
Michael
7/13/2010 12:13:28 PM
Hello,

> {quote:title=Kristof Degros wrote:}{quote}
>
> Building with runtime packages .... all you want, but I always try to
> avoid that one, cause the DLL hell will start !

shouldn't make much of a difference if you deploy all BPLs to your application directory...

--
Moritz

"Hey, it compiles! Ship it!"
0
Moritz
7/13/2010 1:04:37 PM
> {quote:title=Moritz Beutel wrote:}{quote}
> - Is it critical for you to be able to use 3rd-party C++ libraries and C++ classes in Delphi without further changes or additional work?
Could be. We have our team split between Delphi (25%) and C++ (75%), and unfortunately very few code of C++ have been used on the Delphi side.
A clean way to reuse it would be quite interesting.


> - Or do you want to use VCL components written in C++ in your Delphi projects?
That would be a plus.


> - Imagine a solution that makes C++ classes visible to Delphi code, with the following restrictions:
>   o the C++ code needs to be built with C++Builder,
>   o the C++ classes which you want to be visible to Delphi need to derive from TObject, and
>   o the public methods and properties only use Delphi-compatible types, i.e. native types such as "int", enumerations, AnsiString/UnicodeString, Set<>, DynamicArray<>, interfaces and other TObject descendants. (Member functions which used C++-specific types simply wouldn't be visible in Delphi.)
>   Would such a solution work for you?
It would.


>   - Could you live with being restricted to building with runtime packages enabled?
Not really. All our apps are compiled/linked with both runtime packages and dynamic RTL disabled.


>   - If some 3rd-party software were able to do this, would you use it in production code? Which factors would determine your answer (price, availability of source code, license agreement, ...)?
Hard to say. But, if Embarcadero could bundle it within the next RAD *that* would be really, really outstanding ;)
0
Luis
7/13/2010 3:00:17 PM
Reply:

Similar Artilces:

Using C++ Code in Delphi XE4 64-bit [Edit]
I am interested in using C++ code in a Delphi XE4 Pro 64-bit app (no iOS, I did not want to pay the "nominal fee", at least not yet). I don't want to use a DLL, I want to link the C++ right into the 64-bit EXE. It is not easy finding info on this online, there's some stuff but not enough to answer all my questions. 1) Do I need to use C++ Builder 64-bit to create object files that can be linked via $LINK in Delphi XE4 64-bit? Or can I create them using Visual Studio? 2) Do I need to "flatten out" C++ classes in order to share them with Delphi or to share them ...

SEPA components for Delphi with Source Code (Delphi 5
Hi all, in the european union change next year the Bankingformat to the SEPA Format. All peoples and companies must change the bankingssoftware and the costumer data form acountnummers in the new IBAN and BIC numbers. See: http://www.arma-it.de/shop/artikelueber.php?wgruppeid=211&wgruppe_offen=211 Functions: - generate SEPA XML'S - Calc IBAN - BIC Database (DE,AT and CH) Questions: vertrieb@arma-it.de PS: Bankinssoftware for Develpoers (Germany only) http://www.arma-it.de/shop/artikelueber.php?wgruppeid=212&wgruppe_offen=212 El 26/10/13 21:38, A...

Code works in Delphi 7 but not in Delphi 2010 [Edit]
hello, i have a procedure that open's a file by passing the file name as the parameter to the executable. something like this {code} C : \ P r o g r a m F i l e s \ Da c k e r \ D r a c k e r . e x e " G : \ D E l p h i 7 \ D e l p h i 7 A p p _ l o g . t " {code} The source code is {code} procedure OpenFileWithExe var hReg: HKEY; Ret: Longint; RegDataType, RegDataSize: DWORD; CmdLine: array [0..560] of Char; Len: Integer; SInfo: TStartupInfo; PInfo: TProcessInformation; begin Ret := windows.RegOpenKeyEx(HKEY_CURRENT_USER, ...

Using delphi code in C++ builder?
Hi there, How do I go about integrating delphi code into a C++ builder (2007) project. We have a delphi developer that wants to contribute. Is this possible in C++ builder 2007? We also own RAD Studio 2009 licences. I could probably work this out myself but why waste my time when someone here already knows the answer!!! Thanks in advance... Ashley "Ashley Duncan" wrote in message news:214785@forums.codegear.com... > How do I go about integrating delphi code into a C++ builder (2007) > project. Add the .pas files to the project. You won't be abl...

C++equivalent of Delphi code used in IntraWeb?
I am trying to work out what the equivalent of the following piece of Delphi code from the IntraWeb FishFactsDM demo would be in C++. Any one got any ideas? procedure TIWForm1.IWDBGrid1ColumnsTitleClick(Sender: TObject); begin DataModule1.cdsCUSTOMER.IndexFieldNames := TIWDBGridColumn(Sender).DataField end; This is as far as I have been able to get... void __fastcall TIWForm5::IWDBGrid1Columns1TitleClick(TObject *Sender) { UserSession()->ClientDataSet1->IndexFieldNames= } I worked it out finaly... void __fastcall TIWForm5::IWDBGrid1Columns1TitleClick(TObject ...

Coverting some C# code to Delphi (OLE) [Edit]
Hi, I am developing a program that uses the Shoretel COM SDK which interfaces with the Shoretel phone system. We imported the type library into Delphi (in this instance Delphi 6, but suspect the same in XE2) and we get a component named TCtl. One of the properties of this class is OnEventReady. Adding this event generates code procedure TForm1.Ctl1EventReady(Sender: TObject); begin end; Inside this procedure then we are then supposed to retrieve the next event and process it. You get the next event using the GetNextEvent method which looks like... function GetNextEvent: OleVa...

Using 7zip delphi wrapper from C++ [Edit]
I'm trying to utilize "7za.dll" together with this Delphi wrapper - http://www.progdigy.com/?page_id=13 Download of the wrapper itself is here - http://code.google.com/p/d7zip/downloads/detail?name=d7zipv1.2.zip&can=2&q= Having difficulties translating this code to C++ and understanding the wrapper itself: {code} procedure TMainForm.ExtractAllClick(Sender: TObject); var Arch: I7zOutArchive; begin Arch := CreateOutArchive(CLSID_CFormat7z); // add a file Arch.AddFile('c:\test.bin', 'folder\test.bin'); // add files using wil...

XE3: C++ Codes of Delphi Projects [Edit]
Im trying to run this video capture example, but I dont have delphi, so Im trying to convert C++ B XE3 DELPHI FORM -------------------------------------------------------------------------------------------------------------------------------- procedure TForm240.SampleBufferSync; begin VideoCamera.SampleBufferToBitmap(Image1.Bitmap, True); end; procedure TForm240.SampleBufferReady(Sender: TObject; const ATime: TMediaTime); begin TThread.Synchronize(TThread.CurrentThread, SampleBufferSync); end; --------------------------------------------------------------------------------...

I Use C# at Work and Still Prefer Delphi [Edit]
I've been using C# and Visual Studio at work, but I still keep coming back to Delphi. Here what I think Delphi has over C# and VS. Some features I prefer/need: sets and set operations virtual constructors deterministic and virtual destructors virtual static methods messaged based method and DefaultHandler implementation through delegation assign and assignto property promotion published section access to source code examples of property editors, component editors, experts, design time support full library source code interface and implementation sections design time bina...

C++ code to Delphi 7 code
I need the following C++ code convert to Delphi 7 struct FixError { AnsiString section; //Registry section name AnsiString value_name; //Value Name AnsiString value; //Value Data error_reason er; //Error Reason AnsiString file_name; //IF the error reason is system_file (only config_files section) type_of_fix tof; //What shall we do with this error (Delete it OR Leave it) AnsiString uninst_reg_path; //Not used ??? /* Here we are telling the compiler that if someone is comparing the contents of this structure using the != operator then it should com...

How to create runtime and design time packages using c++ and NOT Delphi [Edit]
Hello, I'm creating an Embarcadero component package, written in c++. Up to now, the runtime and design time parts were grouped together in my package, and I did not really need to have two versions of my package, because the difference in code between runtime and design time was very small. But now, I need to add a property editor in my package, meaning add a form that will be used exclusively on design time. I tried to separate my package in 2 distinct projects, one for runtime and other for design time, and f ollowing some documentation, I built the runtime part, then I added the de...

Can a project have a mixture of Delphi & C++ Builder code [Edit]
Is it possible in RAD studio to have a single project (e.g.: Delphi project) and to put some C++ code files (*.h/cpp) into that project tree? ... and when compiling that project, the C++ code files will also be compiled and merged into the single delphi exe file? Actually, what I want to do is: I have some external C++ codes snippets and I want to use it in my Delphi project, with out creating C++ Builder project. Edited by: Markus Ja on Jul 5, 2010 12:05 AM Markus Ja wrote: > Is it possible in RAD studio to have a single project (e.g.: Delphi project) and to put some C++ code file...

Import C or C++ DLL in Delphi [Edit]
Hello, usually I can import a dll written in C in Delhi. To do that I write a unit (wrapper.pas) to link the dll with my VCL project. example: {code} function UCC_OpenCamera(CamId: LongWord; SpeedLimit: integer): UNI_RETURN_TYPE; stdcall external 'UniControl.DLL'; {code} This way works fine for me but it requires writing a lot of code to translate all calls and types in delphi. There isn't another way to "convert/import automaticcally" the .dll? 1) Can I create a package inside C++ Builder and use it inside Delphi? 2) The command line tools IMPLIB.EXE (for ...

Convert C code to Delphi code? Pls!
I am writing Excel Add-In XLL in Delphi. I read documents for making XLL in VC++ from Microsoft [http://msdn.microsoft.com/en-us/library/aa730920.aspx] I am converting C code to Delphi code to make XLL in Delphi IDE. I converted it but may be errors? Somebody help me to correct it please! [CODE] //C++ typedef INT32 BOOL; /* Boolean */ typedef WCHAR XCHAR; /* Wide Character */ typedef INT32 RW; /* XL 12 Row */ typedef INT32 COL; /* XL 12 Column */ [B]//DELPHI[/B] type INT32 = Integer; BOOL= INT32; //* Boolean */ XCHAR= WideChar ; //* Wid...

Web resources about - On Using C++ code from Delphi [Edit] - embarcadero.delphi.non-tech

Delphi - Wikipedia, the free encyclopedia
... an archaeological site and a modern town in Greece on the south-western spur of Mount Parnassus in the valley of Phocis . The site of Delphi ...

Delphi Automotive (@DelphiAuto) on Twitter
Log in Sign up You are on Twitter Mobile because you are using an old version of Internet Explorer. Learn more here Delphi Automotive @ DelphiAuto ...

Delphi Connect for Verizon on the App Store on iTunes
Get Delphi Connect for Verizon on the App Store. See screenshots and ratings, and read customer reviews.


Audi working with Delphi to develop autonomous car tech
Audi is developing an iPad-sized device that will pack all the necessary computing power for a self-driving car

US approves China company's acquisition of Delphi biz
The Committee on Foreign Investment in the United States has formally approved the acquisition of Delphi's global production of braking systems ...

Verizon And Delphi Officially Launch Vehicle Diagnostics Service - $250 For The Module, $5 A Month On ...
If you're a car nut, a paranoid parent, or a small business owner looking to do a little, uh, company vehicle economy analysis, Verizon's teamed ...

Watch out Google: Delphi gives Ars a ride in its self-driving car
The automotive components maker gave Ars a preview ride around the neighborhood. MOUNTAIN VIEW, CA—On Thursday morning I met with Delphi at its ...

The skinny on Delphi's autonomous road trip across the United States
Filed under: Green , Videos , Autonomous Last week, Delphi's autonomous car became the first to complete a coast-to-coast trip across the United ...

Delphi partners with WiTricity on automated wireless charging system
One could easily argue that parking between the white lines at any local hangout presents a challenge for some inexperienced drivers. So, why ...

Resources last updated: 12/2/2015 3:46:32 PM