Solved

Where is the dll destroy event of an ISAPI dll?

Posted on 2004-03-25
4
693 Views
Last Modified: 2010-04-04
Hi All,

I have an ISAPI dll (using TWebModule) and I need to know where I can put the code for when the DLL is UNloaded from IIS.

I can find the following ok:
thread create (TwebModule.onCreate)
thread destroy (TwebModule.onDestroy)
process create (see below - run when loaded in to IIS)

library dart;
uses
  fastsharemem,
  ActiveX,
  ComObj,
  WebBroker,
  ISAPIApp,
  ISAPIThreadPool,
  Classes;
{$R *.RES}
exports
  GetExtensionVersion,
  HttpExtensionProc,
  TerminateExtension;
begin
  myInitRoutine; // THIS IS RUN WHEN ISAPI IS LOADED IN TO IIS
  CoInitFlags := COINIT_MULTITHREADED;
  Application.Initialize;
  Application.CreateForm(TDARTModule, DARTModule);
  Application.Run;
  // can NOT run myKillRoutine here!
end.

I am wondering where I can put the code to run when the ISAPI dll is UNloaded from IIS (e.g. restart IIS).  This is different from when a thread (request or action) is finished...

Cheers,
Peter
0
Comment
Question by:petervullings
4 Comments
 
LVL 20

Accepted Solution

by:
Madshi earned 200 total points
ID: 10686120
Add a unit to your project and use its finalization part. Alternatively look at the documentation about DllProc.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Newbie Thread Programming 1 154
Delphi - replicating a form 8 76
drawing animated level bar based on numbers 3 97
Moving (cutting/pasting) controls in a TTabbedNotebook... 7 34
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question