I have a VFP 9 COM DLL which is working fine. However, whenever I go to
replace the DLL, I need to run IIS Reset to remove it from memory. I cant
rely on the calling application to neatly remove it.

I have put a timer into the DLL to check for a shutdown trigger but I am not
sure how to shut it down properly so that it is removed from memory.

If it was a VFP app, I would use omething like Cancel or Quit. Is this the
same for a COM DLL or is there some other way.

Cheers
David

Re: How to Terminate a VFP COM DLL by Claude

Claude
Thu Feb 02 20:37:54 CST 2006

Mark Frank has done quite a bit of work with this to make it run smoothly:
FUNCTION DESTROY
DestroyEvent(This) && in External FXP
IF this.lClearProgCache
IF ATC("MyCOMutil.FXP",SET("procedure",1)) > 0
RELEASE PROCEDURE MyCOMutil.FXP
ENDIF
CLEAR PROGRAM
ENDIF
ENDFUNC
The external fxp is called by the vfp mtdll and can be replaced at will with
no locking. ActiveVFp also uses this technique.
Another way (not sure it still works in IIS 6) is to run the vfp mtdll in
pooled or high isolation in IIS. Then you can simply 'unload' the mtdll by
pressing the unload button in IIS under the virtual directory it's in.
That's better than iisreset since an unload will only affect your vfp mtdll,
not other applications or the entire web site.
Finally, you could actually put the vfp code in the HTML pages by using
CodeBlock or VFP's scripting. Then those pages can be replaced at will.
This is also available in ActiveVFP...
"David Younger" <davidyounger1@hotmail.com> wrote in message
news:exdjiZGKGHA.3732@TK2MSFTNGP10.phx.gbl...
>I have a VFP 9 COM DLL which is working fine. However, whenever I go to
>replace the DLL, I need to run IIS Reset to remove it from memory. I cant
>rely on the calling application to neatly remove it.
>
> I have put a timer into the DLL to check for a shutdown trigger but I am
> not sure how to shut it down properly so that it is removed from memory.
>
> If it was a VFP app, I would use omething like Cancel or Quit. Is this the
> same for a COM DLL or is there some other way.
>
> Cheers
> David
>