marcp
marcp

Reputation: 1227

what is best way to expose C++Builder code to Delphi

I am primarily a C++Builder these days and have built (for my own use) a powerful and useful set of classes which wrap around a 3rd party database application. I have a client who uses Delphi. I would like to create a package/active X object/DLL/something exposing some components or classes he could use in Delphi to leverage my code. I'm using XE2 and he is up to date (XE5?). I can update if its helpful. The database in question stores numeric data in time series - so I'm moving around large arrays mostly.

Whats the best strategy for that? I can, of course, build a DLL with C style exported functions, but I'm wondering if there are any cool Embarcadero-ey tools I can use to make it more elegant. I know that components written in C++Builder can't be used in Delphi, but what about packages? The documentation is vague.

I'm having trouble finding information about this topic because all searches on Delphi/C++Builder inter-operability assume the other direction.

Upvotes: 2

Views: 166

Answers (1)

Ken White
Ken White

Reputation: 125689

AFAICT, it's not possible to use Builder classes directly (whether components or not) in Delphi.

The Builder object model is somewhat different from the one used in Delphi, and there was never a Delphi wrapper for it. (I'm not sure there could be, as C++ supports features like multiple inheritance that Delphi doesn't.)

The problem you're having finding info is probably because it can't be done. ActiveX would be the only viable alternative I could think of, other than a DLL which provides a flat wrapper. Rudy Velthuis (a member of TeamB who also participates here at SO) wrote an article about this, where he demonstrates both techniques - the flat wrapper and a COM interface - as well as a good explanation of how to apply the techniques. You can find his post here.

Upvotes: 2

Related Questions