UnDiUdin
UnDiUdin

Reputation: 15374

How to use a library made in Delphi in an asp.net application?

One asp.net application I am writing must serve a pdf file and an drawing (dxf AutoCAD file) both created with a Delphi program.

Just to clarify the scenario: I have skilled Delphi developers so I assigned them the task to create the programs who create the pdf and the dxf file.

So there is a total of 3 systems:

1) an asp.net Main application

2) a Delphi application which recieves some parameters (from asp.net) and genreates a pdf file.

3) a Delphi application which recieves some parameters (from asp.net) and genreates a dxf file.

Now the Delphi applications as standalone win32 applications (in which the parmeters are set through UI controls) work both fine and i need to convert them so that they can be used from asp.net.

I am not interested in concurrency/performance issues, my goal is just to call the "part of the system that creates a file" so that I can let the enduser of the asp.net application download it. I can also accept that this is out of threads (I mean: only one user can call in background one of the Delphi applciations at a time)

Could you please suggest the best approach for this?

Before starting this proejct I had in mind "dll" or "command line exe" but now i am in doubt and wonder that may be i am missing some more convenient technique.

Please consider that porting to c# the libraries it is not an option since we used some 3rd party Delphi components that have no a 100% .net counterpart.

Upvotes: 0

Views: 587

Answers (1)

Remy Lebeau
Remy Lebeau

Reputation: 595295

Years ago (around the Delphi 8 timeframe), there was an actual Delphi.NET compiler that could produce .NET assemblies that run in ASP.NET (my own website still runs today on some ASP.NET assemblies I wrote with Delphi.NET), and even use Delphi as a scripting language in ASP.NET coding. But Delphi.NET is now a dead product and .NET is no longer a supported platform by any modern Delphi compiler.

So, if you want to run Delphi code in ASP.NET, you are going to have to either:

  1. Write a plain DLL and install it into your site's \bin folder, and then access it using PInvoke.

  2. Write a COM object and install it on the server machine, and then access it using COM interop (see the Server.CreateObject() method).

  3. port your code to another compiler that supports native .NET development.

Upvotes: 4

Related Questions