UniGUI. StandAlone Server / ISAPI Module ...

UniGUI. StandAlone Server / ISAPI Module mode

Mar 28, 2024

I've already written about this transformation. The essence is that developing an application is convenient as a StandAlone Server. Minimum actions to start the program and debug it. You run the server's EXE file, open a browser, type localhost:8077, and there's your program.

Many people format a debugged program as a DLL and run it under IIS as an ISAPI module. I'll write more about this later.

The point is that we need a mode that would allow compiling into an EXE file or DLL file with a simple switch. And such a mode exists in UniGUI.

Do you see the StandAlone Server / ISAPI Module option in the figure below? I usually choose it during development because the EXE is extremely convenient and simple during development, but when the product is ready, I simply switch to DLL using the methods described below.

Reminder of these methods...

Method №1 (fully functional)

Project -> View Source

Note the 1st line!

If left as it is, we will get an EXE file as output. Simply click Run, and a working server appears near the clock after we allow it in the firewall.

If commented out, we will get a DLL file, which is the ISAPI module. However, in this case, we need to click on Project -> Compile.

Important! In this method, close and reopen the project again.

Method №2 (didn't always work for me, error 500 on IIS)

After the "program" line, add compiler directives:

{$EXTENSION dll} {$EXTENSION exe}

If you need an EXE file, comment out "dll", and vice versa.

The method is simple, but it didn't always work for me. Firstly, there were different file sizes when compiled using methods 1) and 2), and secondly, when running on IIS, I encountered a 500 error specifically when compiling using method 2).

The advantage of this method is that you don't need to close and reopen the project.

Enjoy this post?

Buy DelphiFan Forum a coffee

More from DelphiFan Forum