Why do I prefer to use my own DLL or COM server to call Delphi code from C #?

We are on the verge of writing a C # web service that will reveal the functionality contained in the native Delphi GUI application. Why would I have to convert the Delphi code to my native dll and why should I wrap it on a COM server? In other words: what factors do I need to consider when choosing one of them? I'm interested in factors regarding coding, debugging, (automated) testing, deployment (installation on clients), and performance (overhead?).

+7
c # dll interop delphi com
source share
1 answer

COM adds some significant advantages over a simple DLL:

  • OOP support (classes, interfaces)
  • Automatic memory management for strings ( BSTR ), arrays and objects (via interfaces)
  • No need to use the platform call on the .NET side.

So, I would go for COM.

To use the Delphi class in .NET using the DLL, you need to flatten the class on the Delphi side and reinstall it on the .NET side, which is pretty ugly.

Many of Rudi's articles on Delphi and C ++ code also apply to C #:

http://rvelthuis.de/articles/articles-cppobjs.html

+3
source share

All Articles