Using a Delphi DLL in C++

2019-07-17 15:52发布

问题:

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?

回答1:

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.



标签: c++ delphi dll