Solved

Where is the dll destroy event of an ISAPI dll?

Posted on 2004-03-25
4
677 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
Comment Utility
Add a unit to your project and use its finalization part. Alternatively look at the documentation about DllProc.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

762 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now