I have setup a website which uses an old DLL file (created with Delphi 6.0)
created by another individual.

What I would like to do is:
Be able to update (over-write) the DLL file with an updated DLL file from
time to time (this is an automated process - anytime the file
<dllname>.update is put into the host directory, it automatically renames
<dllname>.update to <dllname>.dll. To achieve this, I have had to use a NET
STOP W3SVC nad NET START W3SVC commands - this allows the DLL to be freed up
without restarting the entire IIS service.

At any rate, what I would like to do is to find a way that we could perform
this update WITHOUT resetting the W3SVC service. I have read some about
using COM+ modules, but am confused on whether or not I could us the
delphi-created DLL file to put it in the COM+ module (I get an error
everytime I try).

Simply put - the DLL keeps track of how many active connections are using
it. I would like to modify my VB app (which checks for the <dllname>.update
file - if it exists, it then stops the W3SVC service, backs up the
<dllname>.dll file for backup, then renames the <dllname>.update file to
<dllname>.dll, then restarts the service). I would like to modify this VB
app so that it could somehow allow any active sessions on the DLL to continue
as they are, but that the update could continue and any NEW sessions would be
using the new DLL. Will my current setup allow this, or will restarting the
W3SVC service axe all the current sessions. Is there a way to accomplish
this?

Is there a way to us the Delphi DLL as a COM or COM+ component?

I know I probably have been too clear - this is a totally new area to me.
Please don't hesitate to ask for clarification or further information if it
would help my cause. I will do everything I can to help.

Any assistance would be greatly appreciated.

Thanks,
Skitrees

Re: DLL / Update without restarting Web Service? by Pat

Pat
Fri Feb 04 11:55:40 CST 2005

Prior to IIS6, IIS did not call CoFreeUnusedLibraries with any regularity.
So as a result COM objects once loaded pretty much just stay there. On the
flip side, performance was improved b/c you weren't re-loading and
initializing dlls.

A side effect of this is that you can't update a dll w/out killing the
process. To work around this, you could write a COM object that calls
CoFreeUnusedLibraries, and for all COM objects whose RefCount == 0 and that
implement a DllCanUnloadNow function that actually unloads them they will
get unloaded. Your Delphi COM object may or may not depending on
implementation.


Pat

"skitrees" <skitrees@discussions.microsoft.com> wrote in message
news:D7C3BE36-9628-450F-B6DB-8E2C9A34AA0A@microsoft.com...
>I have setup a website which uses an old DLL file (created with Delphi 6.0)
> created by another individual.
>
> What I would like to do is:
> Be able to update (over-write) the DLL file with an updated DLL file from
> time to time (this is an automated process - anytime the file
> <dllname>.update is put into the host directory, it automatically renames
> <dllname>.update to <dllname>.dll. To achieve this, I have had to use a
> NET
> STOP W3SVC nad NET START W3SVC commands - this allows the DLL to be freed
> up
> without restarting the entire IIS service.
>
> At any rate, what I would like to do is to find a way that we could
> perform
> this update WITHOUT resetting the W3SVC service. I have read some about
> using COM+ modules, but am confused on whether or not I could us the
> delphi-created DLL file to put it in the COM+ module (I get an error
> everytime I try).
>
> Simply put - the DLL keeps track of how many active connections are using
> it. I would like to modify my VB app (which checks for the
> <dllname>.update
> file - if it exists, it then stops the W3SVC service, backs up the
> <dllname>.dll file for backup, then renames the <dllname>.update file to
> <dllname>.dll, then restarts the service). I would like to modify this VB
> app so that it could somehow allow any active sessions on the DLL to
> continue
> as they are, but that the update could continue and any NEW sessions would
> be
> using the new DLL. Will my current setup allow this, or will restarting
> the
> W3SVC service axe all the current sessions. Is there a way to accomplish
> this?
>
> Is there a way to us the Delphi DLL as a COM or COM+ component?
>
> I know I probably have been too clear - this is a totally new area to me.
> Please don't hesitate to ask for clarification or further information if
> it
> would help my cause. I will do everything I can to help.
>
> Any assistance would be greatly appreciated.
>
> Thanks,
> Skitrees