A Midas connection in an ISAPI DLL

To use a MIDAS connection in a ISAPI DLL you need to call the function COInitialize().
The CoInitialize function initializes the COM library and applications need that to make a COM library call.

To use this ISAPI you'll need the simple Midas Server example. The MidasConnection.ConnectType property in this example is set to ctSockets
which means that at the side of the Midas Server a SocketServer must be started. This program (scktsrvr.exe) is located in the Delphi\BIN directory.
If you want to use DCOM then simple change this property to ctDCOM.

library project1;
{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
View-Project Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the DELPHIMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using DELPHIMM.DLL, pass string information
using PChar or ShortString parameters. }uses
SysUtils,
Classes,
NsapiEng,
main in'main.pas'{DataModule1: TDataModule};
begin
IsMultiThread := TRUE;
Datamodule1:=TDatamodule1.Create(nil);
end.