>Hi,
>
>We have a number of customers using a Foxpro webservice for there webshops.
>Once an d a while, we have to update a certain dll (new functionality added etc.)
>To that end, we created another separate webservice who's job it is to download a specified dll and replace it
>in the webservice-directtory.
>That's when we get confronted with dll's which are in use due to a running process.
>
>I'd like to terminate that process, and found to that extent a marvellous piece of code in C.
>unfortunately, this code is to be compiled as EXE only.
>Usage from command line would sound like : Freelib NameOfDll.dll
>
>So here goes, can anyone compile this code in a DLL which we can use from within Foxpro?
>
>Code is from Dalibor Drzik and can be found here :
http://www.codeproject.com/KB/threads/freelib.aspx>
>Thank you so much
>
>Guillaume Engelen
>
All that is not needed. The way to do it is to have a calling PRG that is compiled into the DLL. Then you have your main code in a separate prg.
For example I have 2 files
ChangeDetails.PrgThis is the calling code that is actually compiled into the DLL and will be locked by the IIS process.
Function ChangeDetails(oParameter as Object)
Set Procedure To ChangeDetailsx.prg Additive
ChangeDetailsx(oRequest, This)
Set Procedure To
Clear Program ChangeDetailsx.prg
Return
Endfunc
ChangeDetailsx.prgThis is the code that would normally go into the ChangeDetails() Function
The naming convention helps for maintenance.
This way the ChangeDetails PRG with its function will be compiled and will be locked in memory by IIS but since it never changes, it does not matter. You can open the ChangeDetailsX.PRG and update it and it will not be locked for much of the time.
HTH
Bernard