In Delphi is quite easy if you make use of C++ Builder, since they share parts of the tooling.
With another C++ compiler on Windows, COM is a better approach.
Anywhere else than the usual plain C like APIs.
With another C++ compiler on Windows, COM is a better approach.
Anywhere else than the usual plain C like APIs.
There is a bit of a definition wrapping, and then the C library looks like a pascal one, and unlike most interpreted/JIT/GC/etc languages where the programmer or wrapper has to jump through hoops to transform the data structures to match an in memory C structure, pascal just goes ahead and uses the same datastructure. This yields a far more transparent/efficient interface. Even pascal strings degrade to C strings by skipping the size header, and assuring they are null terminated before calling the C libraries.