Changing IntraWeb application type
Go Up to Getting started with IntraWeb Index
If you have created an IntraWeb (VCL for the Web) application and wish to change it to ISAPI/NSAPI or Apache plugins, you can do it with a few simple changes to your code.
It is, however, recommended that you start with a standalone application, to ease debugging, and later convert the application to an extension.
To change your standalone application to ISAPI/NSAPI:
- Open the project source file by selecting Project > View Source .
- In the project source file, change the application type from program to library:
- In the uses clause, replace the Forms and IWMain units with ISAPIApp and IWInitISAPI. If you want to use ISAPIThreadPool, include the ISAPIThreadPool unit in the uses clause.
- 
Add the following exports section before the program entry point: exports GetExtensionVersion, HttpExtensionProc, TerminateExtension; 
- 
Replace the contents of begin ... end block with: begin IWRun; end. 
When you are done the project source file should look like this:
 
 library Project1;
 
 uses
   ISAPIApp,
   IWInitISAPI,
   ISAPIThreadPool,
   Unit1 in 'Unit1.pas' {IWForm1: TIWAppForm},
   ServerController in 'ServerController.pas' {IWServerController: TIWServerControllerBase},
   UserSessionUnit in 'UserSessionUnit.pas' {IWUserSession: TIWUserSessionBase};
 
 {$R *.RES}
 
 exports
   GetExtensionVersion,
   HttpExtensionProc,
   TerminateExtension;
 
 begin
   IWRun;
 end.
To change your standalone application to a service application:
- Open the project source file by selecting Project > View Source .
- In the uses clause, replace the Forms and IWMain units with IWInitService.
- Replace the contents of the begin ... end block with:
 begin
   IWRun;
 end.