Is there a tool that creates C header files for Delphi DLLs (Win32)?

So far I have only seen tools and some information for creating Delphi code for a given C header file.

However, in the first case of Delphi, there is a Delphi interface declaration and a generated DLL, not a C header. Are there tools that can extract the necessary information and create a C header file for the DLL?

Such a tool can be useful and saves time in cross-language / cross-platform projects. For example, with a C header file, it would be easier to generate Java JNA binding code automatically using jnaerator . The tool chain will look like this:

Delphi source -> create C header -> convert to Java binding -> use Delphi DLL from Java

+3
source share
2 answers

The native Delphi compiler can output C / C ++ header files from .pas files using the -JPHNE option.

+7
source

While this works theoretically, many Delphi DLLs will use calling conventions such as register, not packing records in standard C ways, etc. Then, problems with RTL arise, problems with the status of the state of the coprocessor, etc.

Probably most C compilers can work around this by adding some pragmas, but I doubt that all Java binding material will eat this.

, DLL , , , , .

Delphi . , , , C. FPC (Free Pascal) , ,

+1

Source: https://habr.com/ru/post/1713934/


All Articles