Using a Delphi DLL in C++

2019-07-17 15:08发布

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?

标签: c++ delphi dll
1条回答
冷血范
2楼-- · 2019-07-17 15:58

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.

查看更多
登录 后发表回答