Jump to content
alank2

Using a C++ Class in Delphi

Recommended Posts

Is there a way to do this?  What I have done successfully is create functions that access the class, put them in a DLL, and then call that DLL from Delphi which does work, but if there is another way it is probably an easier way.

Share this post


Link to post

You can't avoid implementing the C++ class in a DLL or BPL, unfortunately.  However, Delphi can use the C++ object directly if it is derived from a Delphi class (ie, TObject or descendant), or is accessible using an abstract interface that is also defined on the Delphi side, or is accessible via/as a COM object.  Otherwise, you are stuck using plain C-style wrapper functions, as you already have.

  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×