Alireza
Alireza

Reputation: 1038

Using a Delphi DLL in C++

How can I use a DLL written in Delphi in my C++ project (console application)?

I have already read about wrappers. Is there an easier way than that? Or how does this method (wrapper) work?

Upvotes: 2

Views: 1083

Answers (1)

jszpilewski
jszpilewski

Reputation: 1642

It is trivial if you are compiling your C++ project with C++Builder. Just include in your code the C++ wrapper headers generated by the Delphi compiler and link your code with the Delphi library stubs.

However I am not sure if you can manage to do it if you do not have access to wrappers, Delphi source code or Delphi compiler. In such a case or if you are not using C++Builder you must apply typical usage of DLLs and follow standard call convention and COM rules if Delphi code is exporting OO features as COM objects.

Upvotes: 1

Related Questions