Solved

Denied Access to DLL after use in IIS

Posted on 1998-12-31
4
164 Views
Last Modified: 2010-04-16
I've written an ActiveX component in VC6 and I've registered it on an NT4 Server running IIS4. Once I make a call to the component from an ASP I can't gain access to the file again (to recompile, delete, whatever).

I've stopped the WWW, FTP and Admin services (no Gopher installed) and I wait until inetinfo.exe unloads itself, yet still I cannot gain access to the DLL. Eventually the Admin service will start up again and along with it inetinfo.exe.

How can I get IIS or whatever else may be using the DLL to let go of it?

BTW, the same thing happens with the Personal Web Server on the NT4 WS Development machine. Even after I stop the server, the DLL is locked down.

Andrew
0
Comment
Question by:forloop
  • 2
4 Comments
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 1181366
Can try unload DLL from memory:

    HMODULE hDll = ::GetModuleHandle("NAME.DLL");
    if (hDll)
      {
         char buff[101];
         ::GetModuleFileName(hDll,buff,100);
         int  nModule = GetModuleUsage(hDll);
         for (int i = 0; i < nModule; i++)
           FreeLibrary(hDll);
       }
Can be, after this you can edit DLL
0
 
LVL 11

Accepted Solution

by:
mikeblas earned 50 total points
ID: 1181367
Forcing the DLL out of memory is guaranteed to cause you some stability problems.

If the DLL is still in memory even after all the IIS services (not just the web service) have been shut down, the service you've written has a reference leak and needs to be debugged.

B ekiM
0
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 1181368
If you want "utility" solution, i can  send you UNLOAD.EXE

0
 

Author Comment

by:forloop
ID: 1181369
Well, turns out I recompiled the DLL under a new name and the new DLL acted as expected. I was able to delete it after I stopped the web services. As far as the orginal DLL. I still can't delete the file.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

863 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

27 Experts available now in Live!

Get 1:1 Help Now