Solved

Unload stucked DLL

Posted on 1998-11-10
4
356 Views
Last Modified: 2013-12-03
Hi!
I am searching for a utility which unload DLL files that stucked in memory after the program exit with GPF.

Thanks,
Gideon
0
Comment
Question by:gidon
[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
  • 2
4 Comments
 
LVL 14

Accepted Solution

by:
AlexVirochovsky earned 50 total points
ID: 1415971
1. Write you EMail and i send you.
2. This can make from  C/C++ program. Code:
    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);
       }
NOTE: if this OWL200.DLL must make loop for nModule -1!!!
Regards, Alex
0
 
LVL 22

Expert Comment

by:nietod
ID: 1415972
A DLL cannot be stuck in memory after the program that uses it crashes.

Windows will destory the memory space for that program and that DLL.  There is no way to "unload" the DLL, it basically doesn't exist any more.
0
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 1415973
Nietod, you are not right. This situation can be in many
reasons and Windows not deleted allways such DLL.
For example, in my programm with OWL (after cratch) rests
OWL200 and after some times i must make BOOT
(function CreateBitmap ended with OWL Exeption).  
Only after solution, that i write in REPLY,  situation OK.
See , too, Previously asked question about use DLL with
VB. (http://www.experts-exchange.com/Q.10084649)
After reply on this question i found more simple solution!
0
 

Author Comment

by:gidon
ID: 1415974
GetModuleUsage() is obselete in Win32

Gideon
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

627 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