Solved

Where is the dll destroy event of an ISAPI dll?

Posted on 2004-03-25
4
702 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

730 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