Call existing Delphi DLL from C#?

I’m trying to determine if Hydra can help me solve a specific problem.

I have a 3rd party Delphi DLL (no source code) that I need to call from C#. I also have a second Delphi DLL (with source code) that calls the functions and procedures in the first Delphi DLL and exports those calls. I can call the second DLL from C# to call to indirectly call the functions and procedures in the first DLL, but there are (seemingly) random MemoryAccessViolations in the second DLL, so I’d like to access the first DLL directly from C#.

Can Hydra help with that? I’ve tried [DllImport] and [UnmanagedFunctionPointer] limited success. Any suggestions would be greatly appreciated.

Kevin,

Hydra should be able to help you with this, yes. You should be able to create a very thing wrapper as a Delphi Non-Visual plugin, that exposes the APIs from the dll as a Hydra-compatible interface. You can then use that plugin from a .NET host application.

—marc

1 Like